1 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2 ; RUN: opt < %s -mtriple=riscv32 -cost-model -cost-kind=throughput -analyze | FileCheck %s --check-prefix=RISCV32
3 ; RUN: opt < %s -mtriple=riscv64 -cost-model -cost-kind=throughput -analyze | FileCheck %s --check-prefix=RISCV64
5 define i32 @reduce_i1(i32 %arg) {
6 ; RISCV32-LABEL: 'reduce_i1'
7 ; RISCV32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %V1 = call i1 @llvm.vector.reduce.or.v1i1(<1 x i1> undef)
8 ; RISCV32-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V2 = call i1 @llvm.vector.reduce.or.v2i1(<2 x i1> undef)
9 ; RISCV32-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %V4 = call i1 @llvm.vector.reduce.or.v4i1(<4 x i1> undef)
10 ; RISCV32-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %V8 = call i1 @llvm.vector.reduce.or.v8i1(<8 x i1> undef)
11 ; RISCV32-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %V16 = call i1 @llvm.vector.reduce.or.v16i1(<16 x i1> undef)
12 ; RISCV32-NEXT: Cost Model: Found an estimated cost of 33 for instruction: %V32 = call i1 @llvm.vector.reduce.or.v32i1(<32 x i1> undef)
13 ; RISCV32-NEXT: Cost Model: Found an estimated cost of 66 for instruction: %V64 = call i1 @llvm.vector.reduce.or.v64i1(<64 x i1> undef)
14 ; RISCV32-NEXT: Cost Model: Found an estimated cost of 132 for instruction: %V128 = call i1 @llvm.vector.reduce.or.v128i1(<128 x i1> undef)
15 ; RISCV32-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 undef
17 ; RISCV64-LABEL: 'reduce_i1'
18 ; RISCV64-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %V1 = call i1 @llvm.vector.reduce.or.v1i1(<1 x i1> undef)
19 ; RISCV64-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V2 = call i1 @llvm.vector.reduce.or.v2i1(<2 x i1> undef)
20 ; RISCV64-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %V4 = call i1 @llvm.vector.reduce.or.v4i1(<4 x i1> undef)
21 ; RISCV64-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %V8 = call i1 @llvm.vector.reduce.or.v8i1(<8 x i1> undef)
22 ; RISCV64-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %V16 = call i1 @llvm.vector.reduce.or.v16i1(<16 x i1> undef)
23 ; RISCV64-NEXT: Cost Model: Found an estimated cost of 33 for instruction: %V32 = call i1 @llvm.vector.reduce.or.v32i1(<32 x i1> undef)
24 ; RISCV64-NEXT: Cost Model: Found an estimated cost of 65 for instruction: %V64 = call i1 @llvm.vector.reduce.or.v64i1(<64 x i1> undef)
25 ; RISCV64-NEXT: Cost Model: Found an estimated cost of 130 for instruction: %V128 = call i1 @llvm.vector.reduce.or.v128i1(<128 x i1> undef)
26 ; RISCV64-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 undef
28 %V1 = call i1 @llvm.vector.reduce.or.v1i1(<1 x i1> undef)
29 %V2 = call i1 @llvm.vector.reduce.or.v2i1(<2 x i1> undef)
30 %V4 = call i1 @llvm.vector.reduce.or.v4i1(<4 x i1> undef)
31 %V8 = call i1 @llvm.vector.reduce.or.v8i1(<8 x i1> undef)
32 %V16 = call i1 @llvm.vector.reduce.or.v16i1(<16 x i1> undef)
33 %V32 = call i1 @llvm.vector.reduce.or.v32i1(<32 x i1> undef)
34 %V64 = call i1 @llvm.vector.reduce.or.v64i1(<64 x i1> undef)
35 %V128 = call i1 @llvm.vector.reduce.or.v128i1(<128 x i1> undef)
39 declare i1 @llvm.vector.reduce.or.v1i1(<1 x i1>)
40 declare i1 @llvm.vector.reduce.or.v2i1(<2 x i1>)
41 declare i1 @llvm.vector.reduce.or.v4i1(<4 x i1>)
42 declare i1 @llvm.vector.reduce.or.v8i1(<8 x i1>)
43 declare i1 @llvm.vector.reduce.or.v16i1(<16 x i1>)
44 declare i1 @llvm.vector.reduce.or.v32i1(<32 x i1>)
45 declare i1 @llvm.vector.reduce.or.v64i1(<64 x i1>)
46 declare i1 @llvm.vector.reduce.or.v128i1(<128 x i1>)