Skip to content

Commit 60470ac

Browse files
committed
[Cost]Add tests for boolean and/or reductions, NFC.
Tests with the default costs for boolean and/or reductions. Differential Revision: https://reviews.llvm.org/D97793
1 parent 89d331a commit 60470ac

File tree

12 files changed

+410
-0
lines changed

12 files changed

+410
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2+
; RUN: opt < %s -mtriple=aarch64-unknown-linux-gnu -cost-model -cost-kind=throughput -analyze | FileCheck %s
3+
4+
define i32 @reduce_i1(i32 %arg) {
5+
; CHECK-LABEL: 'reduce_i1'
6+
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %V1 = call i1 @llvm.vector.reduce.and.v1i1(<1 x i1> undef)
7+
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i1 @llvm.vector.reduce.and.v2i1(<2 x i1> undef)
8+
; CHECK-NEXT: Cost Model: Found an estimated cost of 38 for instruction: %V4 = call i1 @llvm.vector.reduce.and.v4i1(<4 x i1> undef)
9+
; CHECK-NEXT: Cost Model: Found an estimated cost of 129 for instruction: %V8 = call i1 @llvm.vector.reduce.and.v8i1(<8 x i1> undef)
10+
; CHECK-NEXT: Cost Model: Found an estimated cost of 364 for instruction: %V16 = call i1 @llvm.vector.reduce.and.v16i1(<16 x i1> undef)
11+
; CHECK-NEXT: Cost Model: Found an estimated cost of 455 for instruction: %V32 = call i1 @llvm.vector.reduce.and.v32i1(<32 x i1> undef)
12+
; CHECK-NEXT: Cost Model: Found an estimated cost of 637 for instruction: %V64 = call i1 @llvm.vector.reduce.and.v64i1(<64 x i1> undef)
13+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1001 for instruction: %V128 = call i1 @llvm.vector.reduce.and.v128i1(<128 x i1> undef)
14+
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
15+
;
16+
%V1 = call i1 @llvm.vector.reduce.and.v1i1(<1 x i1> undef)
17+
%V2 = call i1 @llvm.vector.reduce.and.v2i1(<2 x i1> undef)
18+
%V4 = call i1 @llvm.vector.reduce.and.v4i1(<4 x i1> undef)
19+
%V8 = call i1 @llvm.vector.reduce.and.v8i1(<8 x i1> undef)
20+
%V16 = call i1 @llvm.vector.reduce.and.v16i1(<16 x i1> undef)
21+
%V32 = call i1 @llvm.vector.reduce.and.v32i1(<32 x i1> undef)
22+
%V64 = call i1 @llvm.vector.reduce.and.v64i1(<64 x i1> undef)
23+
%V128 = call i1 @llvm.vector.reduce.and.v128i1(<128 x i1> undef)
24+
ret i32 undef
25+
}
26+
27+
declare i1 @llvm.vector.reduce.and.v1i1(<1 x i1>)
28+
declare i1 @llvm.vector.reduce.and.v2i1(<2 x i1>)
29+
declare i1 @llvm.vector.reduce.and.v4i1(<4 x i1>)
30+
declare i1 @llvm.vector.reduce.and.v8i1(<8 x i1>)
31+
declare i1 @llvm.vector.reduce.and.v16i1(<16 x i1>)
32+
declare i1 @llvm.vector.reduce.and.v32i1(<32 x i1>)
33+
declare i1 @llvm.vector.reduce.and.v64i1(<64 x i1>)
34+
declare i1 @llvm.vector.reduce.and.v128i1(<128 x i1>)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2+
; RUN: opt < %s -mtriple=aarch64-unknown-linux-gnu -cost-model -cost-kind=throughput -analyze | FileCheck %s
3+
4+
define i32 @reduce_i1(i32 %arg) {
5+
; CHECK-LABEL: 'reduce_i1'
6+
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %V1 = call i1 @llvm.vector.reduce.or.v1i1(<1 x i1> undef)
7+
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i1 @llvm.vector.reduce.or.v2i1(<2 x i1> undef)
8+
; CHECK-NEXT: Cost Model: Found an estimated cost of 38 for instruction: %V4 = call i1 @llvm.vector.reduce.or.v4i1(<4 x i1> undef)
9+
; CHECK-NEXT: Cost Model: Found an estimated cost of 129 for instruction: %V8 = call i1 @llvm.vector.reduce.or.v8i1(<8 x i1> undef)
10+
; CHECK-NEXT: Cost Model: Found an estimated cost of 364 for instruction: %V16 = call i1 @llvm.vector.reduce.or.v16i1(<16 x i1> undef)
11+
; CHECK-NEXT: Cost Model: Found an estimated cost of 455 for instruction: %V32 = call i1 @llvm.vector.reduce.or.v32i1(<32 x i1> undef)
12+
; CHECK-NEXT: Cost Model: Found an estimated cost of 637 for instruction: %V64 = call i1 @llvm.vector.reduce.or.v64i1(<64 x i1> undef)
13+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1001 for instruction: %V128 = call i1 @llvm.vector.reduce.or.v128i1(<128 x i1> undef)
14+
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
15+
;
16+
%V1 = call i1 @llvm.vector.reduce.or.v1i1(<1 x i1> undef)
17+
%V2 = call i1 @llvm.vector.reduce.or.v2i1(<2 x i1> undef)
18+
%V4 = call i1 @llvm.vector.reduce.or.v4i1(<4 x i1> undef)
19+
%V8 = call i1 @llvm.vector.reduce.or.v8i1(<8 x i1> undef)
20+
%V16 = call i1 @llvm.vector.reduce.or.v16i1(<16 x i1> undef)
21+
%V32 = call i1 @llvm.vector.reduce.or.v32i1(<32 x i1> undef)
22+
%V64 = call i1 @llvm.vector.reduce.or.v64i1(<64 x i1> undef)
23+
%V128 = call i1 @llvm.vector.reduce.or.v128i1(<128 x i1> undef)
24+
ret i32 undef
25+
}
26+
27+
declare i1 @llvm.vector.reduce.or.v1i1(<1 x i1>)
28+
declare i1 @llvm.vector.reduce.or.v2i1(<2 x i1>)
29+
declare i1 @llvm.vector.reduce.or.v4i1(<4 x i1>)
30+
declare i1 @llvm.vector.reduce.or.v8i1(<8 x i1>)
31+
declare i1 @llvm.vector.reduce.or.v16i1(<16 x i1>)
32+
declare i1 @llvm.vector.reduce.or.v32i1(<32 x i1>)
33+
declare i1 @llvm.vector.reduce.or.v64i1(<64 x i1>)
34+
declare i1 @llvm.vector.reduce.or.v128i1(<128 x i1>)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2+
; RUN: opt < %s -mtriple=amdgcn-unknown-amdhsa -cost-model -cost-kind=throughput -analyze | FileCheck %s
3+
4+
define i32 @reduce_i1(i32 %arg) {
5+
; CHECK-LABEL: 'reduce_i1'
6+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %V1 = call i1 @llvm.vector.reduce.and.v1i1(<1 x i1> undef)
7+
; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V2 = call i1 @llvm.vector.reduce.and.v2i1(<2 x i1> undef)
8+
; CHECK-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %V4 = call i1 @llvm.vector.reduce.and.v4i1(<4 x i1> undef)
9+
; CHECK-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %V8 = call i1 @llvm.vector.reduce.and.v8i1(<8 x i1> undef)
10+
; CHECK-NEXT: Cost Model: Found an estimated cost of 46 for instruction: %V16 = call i1 @llvm.vector.reduce.and.v16i1(<16 x i1> undef)
11+
; CHECK-NEXT: Cost Model: Found an estimated cost of 94 for instruction: %V32 = call i1 @llvm.vector.reduce.and.v32i1(<32 x i1> undef)
12+
; CHECK-NEXT: Cost Model: Found an estimated cost of 190 for instruction: %V64 = call i1 @llvm.vector.reduce.and.v64i1(<64 x i1> undef)
13+
; CHECK-NEXT: Cost Model: Found an estimated cost of 382 for instruction: %V128 = call i1 @llvm.vector.reduce.and.v128i1(<128 x i1> undef)
14+
; CHECK-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret i32 undef
15+
;
16+
%V1 = call i1 @llvm.vector.reduce.and.v1i1(<1 x i1> undef)
17+
%V2 = call i1 @llvm.vector.reduce.and.v2i1(<2 x i1> undef)
18+
%V4 = call i1 @llvm.vector.reduce.and.v4i1(<4 x i1> undef)
19+
%V8 = call i1 @llvm.vector.reduce.and.v8i1(<8 x i1> undef)
20+
%V16 = call i1 @llvm.vector.reduce.and.v16i1(<16 x i1> undef)
21+
%V32 = call i1 @llvm.vector.reduce.and.v32i1(<32 x i1> undef)
22+
%V64 = call i1 @llvm.vector.reduce.and.v64i1(<64 x i1> undef)
23+
%V128 = call i1 @llvm.vector.reduce.and.v128i1(<128 x i1> undef)
24+
ret i32 undef
25+
}
26+
27+
declare i1 @llvm.vector.reduce.and.v1i1(<1 x i1>)
28+
declare i1 @llvm.vector.reduce.and.v2i1(<2 x i1>)
29+
declare i1 @llvm.vector.reduce.and.v4i1(<4 x i1>)
30+
declare i1 @llvm.vector.reduce.and.v8i1(<8 x i1>)
31+
declare i1 @llvm.vector.reduce.and.v16i1(<16 x i1>)
32+
declare i1 @llvm.vector.reduce.and.v32i1(<32 x i1>)
33+
declare i1 @llvm.vector.reduce.and.v64i1(<64 x i1>)
34+
declare i1 @llvm.vector.reduce.and.v128i1(<128 x i1>)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2+
; RUN: opt < %s -mtriple=amdgcn-unknown-amdhsa -cost-model -cost-kind=throughput -analyze | FileCheck %s
3+
4+
define i32 @reduce_i1(i32 %arg) {
5+
; CHECK-LABEL: 'reduce_i1'
6+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %V1 = call i1 @llvm.vector.reduce.or.v1i1(<1 x i1> undef)
7+
; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V2 = call i1 @llvm.vector.reduce.or.v2i1(<2 x i1> undef)
8+
; CHECK-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %V4 = call i1 @llvm.vector.reduce.or.v4i1(<4 x i1> undef)
9+
; CHECK-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %V8 = call i1 @llvm.vector.reduce.or.v8i1(<8 x i1> undef)
10+
; CHECK-NEXT: Cost Model: Found an estimated cost of 46 for instruction: %V16 = call i1 @llvm.vector.reduce.or.v16i1(<16 x i1> undef)
11+
; CHECK-NEXT: Cost Model: Found an estimated cost of 94 for instruction: %V32 = call i1 @llvm.vector.reduce.or.v32i1(<32 x i1> undef)
12+
; CHECK-NEXT: Cost Model: Found an estimated cost of 190 for instruction: %V64 = call i1 @llvm.vector.reduce.or.v64i1(<64 x i1> undef)
13+
; CHECK-NEXT: Cost Model: Found an estimated cost of 382 for instruction: %V128 = call i1 @llvm.vector.reduce.or.v128i1(<128 x i1> undef)
14+
; CHECK-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret i32 undef
15+
;
16+
%V1 = call i1 @llvm.vector.reduce.or.v1i1(<1 x i1> undef)
17+
%V2 = call i1 @llvm.vector.reduce.or.v2i1(<2 x i1> undef)
18+
%V4 = call i1 @llvm.vector.reduce.or.v4i1(<4 x i1> undef)
19+
%V8 = call i1 @llvm.vector.reduce.or.v8i1(<8 x i1> undef)
20+
%V16 = call i1 @llvm.vector.reduce.or.v16i1(<16 x i1> undef)
21+
%V32 = call i1 @llvm.vector.reduce.or.v32i1(<32 x i1> undef)
22+
%V64 = call i1 @llvm.vector.reduce.or.v64i1(<64 x i1> undef)
23+
%V128 = call i1 @llvm.vector.reduce.or.v128i1(<128 x i1> undef)
24+
ret i32 undef
25+
}
26+
27+
declare i1 @llvm.vector.reduce.or.v1i1(<1 x i1>)
28+
declare i1 @llvm.vector.reduce.or.v2i1(<2 x i1>)
29+
declare i1 @llvm.vector.reduce.or.v4i1(<4 x i1>)
30+
declare i1 @llvm.vector.reduce.or.v8i1(<8 x i1>)
31+
declare i1 @llvm.vector.reduce.or.v16i1(<16 x i1>)
32+
declare i1 @llvm.vector.reduce.or.v32i1(<32 x i1>)
33+
declare i1 @llvm.vector.reduce.or.v64i1(<64 x i1>)
34+
declare i1 @llvm.vector.reduce.or.v128i1(<128 x i1>)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2+
; RUN: opt < %s -mtriple=armv8a-linux-gnueabihf -cost-model -cost-kind=throughput -analyze | FileCheck %s
3+
4+
define i32 @reduce_i1(i32 %arg) {
5+
; CHECK-LABEL: 'reduce_i1'
6+
; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V1 = call i1 @llvm.vector.reduce.and.v1i1(<1 x i1> undef)
7+
; CHECK-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %V2 = call i1 @llvm.vector.reduce.and.v2i1(<2 x i1> undef)
8+
; CHECK-NEXT: Cost Model: Found an estimated cost of 53 for instruction: %V4 = call i1 @llvm.vector.reduce.and.v4i1(<4 x i1> undef)
9+
; CHECK-NEXT: Cost Model: Found an estimated cost of 150 for instruction: %V8 = call i1 @llvm.vector.reduce.and.v8i1(<8 x i1> undef)
10+
; CHECK-NEXT: Cost Model: Found an estimated cost of 391 for instruction: %V16 = call i1 @llvm.vector.reduce.and.v16i1(<16 x i1> undef)
11+
; CHECK-NEXT: Cost Model: Found an estimated cost of 488 for instruction: %V32 = call i1 @llvm.vector.reduce.and.v32i1(<32 x i1> undef)
12+
; CHECK-NEXT: Cost Model: Found an estimated cost of 682 for instruction: %V64 = call i1 @llvm.vector.reduce.and.v64i1(<64 x i1> undef)
13+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1070 for instruction: %V128 = call i1 @llvm.vector.reduce.and.v128i1(<128 x i1> undef)
14+
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
15+
;
16+
%V1 = call i1 @llvm.vector.reduce.and.v1i1(<1 x i1> undef)
17+
%V2 = call i1 @llvm.vector.reduce.and.v2i1(<2 x i1> undef)
18+
%V4 = call i1 @llvm.vector.reduce.and.v4i1(<4 x i1> undef)
19+
%V8 = call i1 @llvm.vector.reduce.and.v8i1(<8 x i1> undef)
20+
%V16 = call i1 @llvm.vector.reduce.and.v16i1(<16 x i1> undef)
21+
%V32 = call i1 @llvm.vector.reduce.and.v32i1(<32 x i1> undef)
22+
%V64 = call i1 @llvm.vector.reduce.and.v64i1(<64 x i1> undef)
23+
%V128 = call i1 @llvm.vector.reduce.and.v128i1(<128 x i1> undef)
24+
ret i32 undef
25+
}
26+
27+
declare i1 @llvm.vector.reduce.and.v1i1(<1 x i1>)
28+
declare i1 @llvm.vector.reduce.and.v2i1(<2 x i1>)
29+
declare i1 @llvm.vector.reduce.and.v4i1(<4 x i1>)
30+
declare i1 @llvm.vector.reduce.and.v8i1(<8 x i1>)
31+
declare i1 @llvm.vector.reduce.and.v16i1(<16 x i1>)
32+
declare i1 @llvm.vector.reduce.and.v32i1(<32 x i1>)
33+
declare i1 @llvm.vector.reduce.and.v64i1(<64 x i1>)
34+
declare i1 @llvm.vector.reduce.and.v128i1(<128 x i1>)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2+
; RUN: opt < %s -mtriple=armv8a-linux-gnueabihf -cost-model -cost-kind=throughput -analyze | FileCheck %s
3+
4+
define i32 @reduce_i1(i32 %arg) {
5+
; CHECK-LABEL: 'reduce_i1'
6+
; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V1 = call i1 @llvm.vector.reduce.or.v1i1(<1 x i1> undef)
7+
; CHECK-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %V2 = call i1 @llvm.vector.reduce.or.v2i1(<2 x i1> undef)
8+
; CHECK-NEXT: Cost Model: Found an estimated cost of 53 for instruction: %V4 = call i1 @llvm.vector.reduce.or.v4i1(<4 x i1> undef)
9+
; CHECK-NEXT: Cost Model: Found an estimated cost of 150 for instruction: %V8 = call i1 @llvm.vector.reduce.or.v8i1(<8 x i1> undef)
10+
; CHECK-NEXT: Cost Model: Found an estimated cost of 391 for instruction: %V16 = call i1 @llvm.vector.reduce.or.v16i1(<16 x i1> undef)
11+
; CHECK-NEXT: Cost Model: Found an estimated cost of 488 for instruction: %V32 = call i1 @llvm.vector.reduce.or.v32i1(<32 x i1> undef)
12+
; CHECK-NEXT: Cost Model: Found an estimated cost of 682 for instruction: %V64 = call i1 @llvm.vector.reduce.or.v64i1(<64 x i1> undef)
13+
; CHECK-NEXT: Cost Model: Found an estimated cost of 1070 for instruction: %V128 = call i1 @llvm.vector.reduce.or.v128i1(<128 x i1> undef)
14+
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
15+
;
16+
%V1 = call i1 @llvm.vector.reduce.or.v1i1(<1 x i1> undef)
17+
%V2 = call i1 @llvm.vector.reduce.or.v2i1(<2 x i1> undef)
18+
%V4 = call i1 @llvm.vector.reduce.or.v4i1(<4 x i1> undef)
19+
%V8 = call i1 @llvm.vector.reduce.or.v8i1(<8 x i1> undef)
20+
%V16 = call i1 @llvm.vector.reduce.or.v16i1(<16 x i1> undef)
21+
%V32 = call i1 @llvm.vector.reduce.or.v32i1(<32 x i1> undef)
22+
%V64 = call i1 @llvm.vector.reduce.or.v64i1(<64 x i1> undef)
23+
%V128 = call i1 @llvm.vector.reduce.or.v128i1(<128 x i1> undef)
24+
ret i32 undef
25+
}
26+
27+
declare i1 @llvm.vector.reduce.or.v1i1(<1 x i1>)
28+
declare i1 @llvm.vector.reduce.or.v2i1(<2 x i1>)
29+
declare i1 @llvm.vector.reduce.or.v4i1(<4 x i1>)
30+
declare i1 @llvm.vector.reduce.or.v8i1(<8 x i1>)
31+
declare i1 @llvm.vector.reduce.or.v16i1(<16 x i1>)
32+
declare i1 @llvm.vector.reduce.or.v32i1(<32 x i1>)
33+
declare i1 @llvm.vector.reduce.or.v64i1(<64 x i1>)
34+
declare i1 @llvm.vector.reduce.or.v128i1(<128 x i1>)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2+
; RUN: opt < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr8 -cost-model -cost-kind=throughput -analyze | FileCheck %s
3+
4+
define i32 @reduce_i1(i32 %arg) {
5+
; CHECK-LABEL: 'reduce_i1'
6+
; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V1 = call i1 @llvm.vector.reduce.and.v1i1(<1 x i1> undef)
7+
; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %V2 = call i1 @llvm.vector.reduce.and.v2i1(<2 x i1> undef)
8+
; CHECK-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %V4 = call i1 @llvm.vector.reduce.and.v4i1(<4 x i1> undef)
9+
; CHECK-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %V8 = call i1 @llvm.vector.reduce.and.v8i1(<8 x i1> undef)
10+
; CHECK-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %V16 = call i1 @llvm.vector.reduce.and.v16i1(<16 x i1> undef)
11+
; CHECK-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %V32 = call i1 @llvm.vector.reduce.and.v32i1(<32 x i1> undef)
12+
; CHECK-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %V64 = call i1 @llvm.vector.reduce.and.v64i1(<64 x i1> undef)
13+
; CHECK-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %V128 = call i1 @llvm.vector.reduce.and.v128i1(<128 x i1> undef)
14+
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
15+
;
16+
%V1 = call i1 @llvm.vector.reduce.and.v1i1(<1 x i1> undef)
17+
%V2 = call i1 @llvm.vector.reduce.and.v2i1(<2 x i1> undef)
18+
%V4 = call i1 @llvm.vector.reduce.and.v4i1(<4 x i1> undef)
19+
%V8 = call i1 @llvm.vector.reduce.and.v8i1(<8 x i1> undef)
20+
%V16 = call i1 @llvm.vector.reduce.and.v16i1(<16 x i1> undef)
21+
%V32 = call i1 @llvm.vector.reduce.and.v32i1(<32 x i1> undef)
22+
%V64 = call i1 @llvm.vector.reduce.and.v64i1(<64 x i1> undef)
23+
%V128 = call i1 @llvm.vector.reduce.and.v128i1(<128 x i1> undef)
24+
ret i32 undef
25+
}
26+
27+
declare i1 @llvm.vector.reduce.and.v1i1(<1 x i1>)
28+
declare i1 @llvm.vector.reduce.and.v2i1(<2 x i1>)
29+
declare i1 @llvm.vector.reduce.and.v4i1(<4 x i1>)
30+
declare i1 @llvm.vector.reduce.and.v8i1(<8 x i1>)
31+
declare i1 @llvm.vector.reduce.and.v16i1(<16 x i1>)
32+
declare i1 @llvm.vector.reduce.and.v32i1(<32 x i1>)
33+
declare i1 @llvm.vector.reduce.and.v64i1(<64 x i1>)
34+
declare i1 @llvm.vector.reduce.and.v128i1(<128 x i1>)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2+
; RUN: opt < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr8 -cost-model -cost-kind=throughput -analyze | FileCheck %s
3+
4+
define i32 @reduce_i1(i32 %arg) {
5+
; CHECK-LABEL: 'reduce_i1'
6+
; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V1 = call i1 @llvm.vector.reduce.or.v1i1(<1 x i1> undef)
7+
; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %V2 = call i1 @llvm.vector.reduce.or.v2i1(<2 x i1> undef)
8+
; CHECK-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %V4 = call i1 @llvm.vector.reduce.or.v4i1(<4 x i1> undef)
9+
; CHECK-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %V8 = call i1 @llvm.vector.reduce.or.v8i1(<8 x i1> undef)
10+
; CHECK-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %V16 = call i1 @llvm.vector.reduce.or.v16i1(<16 x i1> undef)
11+
; CHECK-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %V32 = call i1 @llvm.vector.reduce.or.v32i1(<32 x i1> undef)
12+
; CHECK-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %V64 = call i1 @llvm.vector.reduce.or.v64i1(<64 x i1> undef)
13+
; CHECK-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %V128 = call i1 @llvm.vector.reduce.or.v128i1(<128 x i1> undef)
14+
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
15+
;
16+
%V1 = call i1 @llvm.vector.reduce.or.v1i1(<1 x i1> undef)
17+
%V2 = call i1 @llvm.vector.reduce.or.v2i1(<2 x i1> undef)
18+
%V4 = call i1 @llvm.vector.reduce.or.v4i1(<4 x i1> undef)
19+
%V8 = call i1 @llvm.vector.reduce.or.v8i1(<8 x i1> undef)
20+
%V16 = call i1 @llvm.vector.reduce.or.v16i1(<16 x i1> undef)
21+
%V32 = call i1 @llvm.vector.reduce.or.v32i1(<32 x i1> undef)
22+
%V64 = call i1 @llvm.vector.reduce.or.v64i1(<64 x i1> undef)
23+
%V128 = call i1 @llvm.vector.reduce.or.v128i1(<128 x i1> undef)
24+
ret i32 undef
25+
}
26+
27+
declare i1 @llvm.vector.reduce.or.v1i1(<1 x i1>)
28+
declare i1 @llvm.vector.reduce.or.v2i1(<2 x i1>)
29+
declare i1 @llvm.vector.reduce.or.v4i1(<4 x i1>)
30+
declare i1 @llvm.vector.reduce.or.v8i1(<8 x i1>)
31+
declare i1 @llvm.vector.reduce.or.v16i1(<16 x i1>)
32+
declare i1 @llvm.vector.reduce.or.v32i1(<32 x i1>)
33+
declare i1 @llvm.vector.reduce.or.v64i1(<64 x i1>)
34+
declare i1 @llvm.vector.reduce.or.v128i1(<128 x i1>)

0 commit comments

Comments
 (0)