xref: /llvm-project/llvm/test/Analysis/CostModel/RISCV/fca-load-store.ll (revision 400b725c2740ee29560bac9ad870b4ddb56bf3f2)
1; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=riscv64 -mattr=+v,+f,+d,+zfh,+zvfh -riscv-v-fixed-length-vector-lmul-max=1 < %s | FileCheck %s
3; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=riscv64 -mattr=+f,+d < %s | FileCheck %s
4
5define void @load(ptr %p) {
6; CHECK-LABEL: 'load'
7; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %1 = load [2 x i64], ptr %p, align 8
8; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %2 = load [4 x i64], ptr %p, align 8
9; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %3 = load { i64, i64 }, ptr %p, align 8
10; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %4 = load { i64, i32 }, ptr %p, align 8
11; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
12;
13  load [2 x i64], ptr %p
14  load [4 x i64], ptr %p
15  load {i64,i64}, ptr %p
16  load {i64,i32}, ptr %p
17
18  ret void
19}
20
21define void @store(ptr %p) {
22; CHECK-LABEL: 'store'
23; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: store [2 x i64] undef, ptr %p, align 8
24; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: store [4 x i64] undef, ptr %p, align 8
25; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: store { i64, i64 } undef, ptr %p, align 8
26; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: store { i64, i32 } undef, ptr %p, align 8
27; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret void
28;
29  store [2 x i64] undef, ptr %p
30  store [4 x i64] undef, ptr %p
31  store {i64,i64} undef, ptr %p
32  store {i64,i32} undef, ptr %p
33
34  ret void
35}
36
37