|
1 | 1 | ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
|
2 |
| -; RUN: opt < %s -mtriple=riscv64 -passes="print<cost-model>" -cost-kind=throughput 2>&1 -disable-output | FileCheck %s --check-prefixes=CHECK |
| 2 | +; RUN: opt < %s -mtriple=riscv64 -mcpu=sifive-u74 -passes="print<cost-model>" -cost-kind=throughput 2>&1 -disable-output | FileCheck %s --check-prefixes=SFB64 |
| 3 | +; RUN: opt < %s -mtriple=riscv64 -passes="print<cost-model>" -cost-kind=throughput 2>&1 -disable-output | FileCheck %s --check-prefixes=RV64 |
3 | 4 |
|
4 |
| -define void @cmp-select() { |
5 |
| -; CHECK-LABEL: 'cmp-select' |
6 |
| -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %cmp1 = icmp slt i64 0, 1 |
7 |
| -; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %select1 = select i1 %cmp1, i32 5, i32 4 |
8 |
| -; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void |
| 5 | +define void @icmp-select() { |
| 6 | +; SFB64-LABEL: 'icmp-select' |
| 7 | +; SFB64-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %cmp1 = icmp slt i64 0, 1 |
| 8 | +; SFB64-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %select1 = select i1 %cmp1, i32 5, i32 4 |
| 9 | +; SFB64-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void |
| 10 | +; |
| 11 | +; RV64-LABEL: 'icmp-select' |
| 12 | +; RV64-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %cmp1 = icmp slt i64 0, 1 |
| 13 | +; RV64-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %select1 = select i1 %cmp1, i32 5, i32 4 |
| 14 | +; RV64-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void |
9 | 15 | ;
|
10 | 16 | %cmp1 = icmp slt i64 0, 1
|
11 | 17 | %select1 = select i1 %cmp1, i32 5, i32 4
|
12 | 18 | ret void
|
13 | 19 | }
|
| 20 | + |
| 21 | +define void @fcmp-select() { |
| 22 | +; SFB64-LABEL: 'fcmp-select' |
| 23 | +; SFB64-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %fcmp1 = fcmp ogt float 0.000000e+00, 1.000000e+00 |
| 24 | +; SFB64-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %select1 = select i1 %fcmp1, i32 5, i32 4 |
| 25 | +; SFB64-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void |
| 26 | +; |
| 27 | +; RV64-LABEL: 'fcmp-select' |
| 28 | +; RV64-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %fcmp1 = fcmp ogt float 0.000000e+00, 1.000000e+00 |
| 29 | +; RV64-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %select1 = select i1 %fcmp1, i32 5, i32 4 |
| 30 | +; RV64-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void |
| 31 | +; |
| 32 | + %fcmp1 = fcmp ogt float 0.0, 1.0 |
| 33 | + %select1 = select i1 %fcmp1, i32 5, i32 4 |
| 34 | + ret void |
| 35 | +} |
0 commit comments