xref: /llvm-project/llvm/test/Analysis/CostModel/RISCV/reduce-or.ll (revision 46829e5430aa3f086389549538d5289769d67076)
160470ac7SAlexey Bataev; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2400b725cSLuke Lau; RUN: opt < %s -mtriple=riscv32 -mattr=+v -passes="print<cost-model>" -cost-kind=throughput 2>&1 -disable-output | FileCheck %s
3400b725cSLuke Lau; RUN: opt < %s -mtriple=riscv64 -mattr=+v -passes="print<cost-model>" -cost-kind=throughput 2>&1 -disable-output | FileCheck %s
4400b725cSLuke Lau; RUN: opt < %s -mtriple=riscv32 -mattr=+v -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output | FileCheck %s --check-prefix=SIZE
5400b725cSLuke Lau; RUN: opt < %s -mtriple=riscv64 -mattr=+v -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output | FileCheck %s --check-prefix=SIZE
660470ac7SAlexey Bataev
760470ac7SAlexey Bataevdefine i32 @reduce_i1(i32 %arg) {
8536095a2SPhilip Reames; CHECK-LABEL: 'reduce_i1'
9536095a2SPhilip Reames; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V1 = call i1 @llvm.vector.reduce.or.v1i1(<1 x i1> undef)
10536095a2SPhilip Reames; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i1 @llvm.vector.reduce.or.v2i1(<2 x i1> undef)
11536095a2SPhilip Reames; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V4 = call i1 @llvm.vector.reduce.or.v4i1(<4 x i1> undef)
12536095a2SPhilip Reames; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V8 = call i1 @llvm.vector.reduce.or.v8i1(<8 x i1> undef)
13536095a2SPhilip Reames; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V16 = call i1 @llvm.vector.reduce.or.v16i1(<16 x i1> undef)
14536095a2SPhilip Reames; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V32 = call i1 @llvm.vector.reduce.or.v32i1(<32 x i1> undef)
15536095a2SPhilip Reames; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V64 = call i1 @llvm.vector.reduce.or.v64i1(<64 x i1> undef)
16536095a2SPhilip Reames; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V128 = call i1 @llvm.vector.reduce.or.v128i1(<128 x i1> undef)
17400b725cSLuke Lau; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %V256 = call i1 @llvm.vector.reduce.or.v256i1(<256 x i1> undef)
18400b725cSLuke Lau; CHECK-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %V512 = call i1 @llvm.vector.reduce.or.v512i1(<512 x i1> undef)
19400b725cSLuke Lau; CHECK-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %V1024 = call i1 @llvm.vector.reduce.or.v1024i1(<1024 x i1> undef)
200a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
21d4595308SPhilip Reames;
22fb661e25SShihPo Hung; SIZE-LABEL: 'reduce_i1'
23fb661e25SShihPo Hung; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V1 = call i1 @llvm.vector.reduce.or.v1i1(<1 x i1> undef)
24fb661e25SShihPo Hung; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i1 @llvm.vector.reduce.or.v2i1(<2 x i1> undef)
25fb661e25SShihPo Hung; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V4 = call i1 @llvm.vector.reduce.or.v4i1(<4 x i1> undef)
26fb661e25SShihPo Hung; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V8 = call i1 @llvm.vector.reduce.or.v8i1(<8 x i1> undef)
27fb661e25SShihPo Hung; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V16 = call i1 @llvm.vector.reduce.or.v16i1(<16 x i1> undef)
28fb661e25SShihPo Hung; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V32 = call i1 @llvm.vector.reduce.or.v32i1(<32 x i1> undef)
29fb661e25SShihPo Hung; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V64 = call i1 @llvm.vector.reduce.or.v64i1(<64 x i1> undef)
30fb661e25SShihPo Hung; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V128 = call i1 @llvm.vector.reduce.or.v128i1(<128 x i1> undef)
31400b725cSLuke Lau; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %V256 = call i1 @llvm.vector.reduce.or.v256i1(<256 x i1> undef)
32400b725cSLuke Lau; SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %V512 = call i1 @llvm.vector.reduce.or.v512i1(<512 x i1> undef)
33400b725cSLuke Lau; SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %V1024 = call i1 @llvm.vector.reduce.or.v1024i1(<1024 x i1> undef)
34fb661e25SShihPo Hung; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 undef
35fb661e25SShihPo Hung;
3660470ac7SAlexey Bataev  %V1   = call i1 @llvm.vector.reduce.or.v1i1(<1 x i1> undef)
3760470ac7SAlexey Bataev  %V2   = call i1 @llvm.vector.reduce.or.v2i1(<2 x i1> undef)
3860470ac7SAlexey Bataev  %V4   = call i1 @llvm.vector.reduce.or.v4i1(<4 x i1> undef)
3960470ac7SAlexey Bataev  %V8   = call i1 @llvm.vector.reduce.or.v8i1(<8 x i1> undef)
4060470ac7SAlexey Bataev  %V16  = call i1 @llvm.vector.reduce.or.v16i1(<16 x i1> undef)
4160470ac7SAlexey Bataev  %V32  = call i1 @llvm.vector.reduce.or.v32i1(<32 x i1> undef)
4260470ac7SAlexey Bataev  %V64  = call i1 @llvm.vector.reduce.or.v64i1(<64 x i1> undef)
4360470ac7SAlexey Bataev  %V128 = call i1 @llvm.vector.reduce.or.v128i1(<128 x i1> undef)
44eb912411SPhilip Reames  %V256 = call i1 @llvm.vector.reduce.or.v256i1(<256 x i1> undef)
45eb912411SPhilip Reames  %V512 = call i1 @llvm.vector.reduce.or.v512i1(<512 x i1> undef)
46eb912411SPhilip Reames  %V1024 = call i1 @llvm.vector.reduce.or.v1024i1(<1024 x i1> undef)
4760470ac7SAlexey Bataev  ret i32 undef
4860470ac7SAlexey Bataev}
4960470ac7SAlexey Bataev
50ae7c6647SYeting Kuodefine i32 @reduce_i8(i32 %arg) {
512247e4deSPhilip Reames; CHECK-LABEL: 'reduce_i8'
52*46829e54SLiqinWeng; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V1 = call i8 @llvm.vector.reduce.or.v1i8(<1 x i8> undef)
53*46829e54SLiqinWeng; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i8 @llvm.vector.reduce.or.v2i8(<2 x i8> undef)
54*46829e54SLiqinWeng; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %V4 = call i8 @llvm.vector.reduce.or.v4i8(<4 x i8> undef)
55*46829e54SLiqinWeng; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V8 = call i8 @llvm.vector.reduce.or.v8i8(<8 x i8> undef)
56*46829e54SLiqinWeng; CHECK-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %V16 = call i8 @llvm.vector.reduce.or.v16i8(<16 x i8> undef)
57*46829e54SLiqinWeng; CHECK-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %V32 = call i8 @llvm.vector.reduce.or.v32i8(<32 x i8> undef)
58*46829e54SLiqinWeng; CHECK-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %V64 = call i8 @llvm.vector.reduce.or.v64i8(<64 x i8> undef)
59*46829e54SLiqinWeng; CHECK-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %V128 = call i8 @llvm.vector.reduce.or.v128i8(<128 x i8> undef)
600a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
61ae7c6647SYeting Kuo;
62fb661e25SShihPo Hung; SIZE-LABEL: 'reduce_i8'
63*46829e54SLiqinWeng; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V1 = call i8 @llvm.vector.reduce.or.v1i8(<1 x i8> undef)
64*46829e54SLiqinWeng; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i8 @llvm.vector.reduce.or.v2i8(<2 x i8> undef)
65*46829e54SLiqinWeng; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V4 = call i8 @llvm.vector.reduce.or.v4i8(<4 x i8> undef)
66*46829e54SLiqinWeng; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V8 = call i8 @llvm.vector.reduce.or.v8i8(<8 x i8> undef)
67*46829e54SLiqinWeng; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V16 = call i8 @llvm.vector.reduce.or.v16i8(<16 x i8> undef)
68*46829e54SLiqinWeng; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V32 = call i8 @llvm.vector.reduce.or.v32i8(<32 x i8> undef)
69*46829e54SLiqinWeng; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V64 = call i8 @llvm.vector.reduce.or.v64i8(<64 x i8> undef)
70*46829e54SLiqinWeng; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V128 = call i8 @llvm.vector.reduce.or.v128i8(<128 x i8> undef)
71fb661e25SShihPo Hung; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 undef
72fb661e25SShihPo Hung;
73ae7c6647SYeting Kuo  %V1   = call i8 @llvm.vector.reduce.or.v1i8(<1 x i8> undef)
74ae7c6647SYeting Kuo  %V2   = call i8 @llvm.vector.reduce.or.v2i8(<2 x i8> undef)
75ae7c6647SYeting Kuo  %V4   = call i8 @llvm.vector.reduce.or.v4i8(<4 x i8> undef)
76ae7c6647SYeting Kuo  %V8   = call i8 @llvm.vector.reduce.or.v8i8(<8 x i8> undef)
77ae7c6647SYeting Kuo  %V16  = call i8 @llvm.vector.reduce.or.v16i8(<16 x i8> undef)
78ae7c6647SYeting Kuo  %V32  = call i8 @llvm.vector.reduce.or.v32i8(<32 x i8> undef)
79ae7c6647SYeting Kuo  %V64  = call i8 @llvm.vector.reduce.or.v64i8(<64 x i8> undef)
80ae7c6647SYeting Kuo  %V128 = call i8 @llvm.vector.reduce.or.v128i8(<128 x i8> undef)
81ae7c6647SYeting Kuo  ret i32 undef
82ae7c6647SYeting Kuo}
83ae7c6647SYeting Kuo
84ae7c6647SYeting Kuodefine i32 @reduce_i16(i32 %arg) {
852247e4deSPhilip Reames; CHECK-LABEL: 'reduce_i16'
86*46829e54SLiqinWeng; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V1 = call i16 @llvm.vector.reduce.or.v1i16(<1 x i16> undef)
87*46829e54SLiqinWeng; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i16 @llvm.vector.reduce.or.v2i16(<2 x i16> undef)
88*46829e54SLiqinWeng; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %V4 = call i16 @llvm.vector.reduce.or.v4i16(<4 x i16> undef)
89*46829e54SLiqinWeng; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V8 = call i16 @llvm.vector.reduce.or.v8i16(<8 x i16> undef)
90*46829e54SLiqinWeng; CHECK-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %V16 = call i16 @llvm.vector.reduce.or.v16i16(<16 x i16> undef)
91*46829e54SLiqinWeng; CHECK-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %V32 = call i16 @llvm.vector.reduce.or.v32i16(<32 x i16> undef)
92*46829e54SLiqinWeng; CHECK-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %V64 = call i16 @llvm.vector.reduce.or.v64i16(<64 x i16> undef)
93*46829e54SLiqinWeng; CHECK-NEXT:  Cost Model: Found an estimated cost of 15 for instruction: %V128 = call i16 @llvm.vector.reduce.or.v128i16(<128 x i16> undef)
940a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
95ae7c6647SYeting Kuo;
96fb661e25SShihPo Hung; SIZE-LABEL: 'reduce_i16'
97*46829e54SLiqinWeng; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V1 = call i16 @llvm.vector.reduce.or.v1i16(<1 x i16> undef)
98*46829e54SLiqinWeng; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i16 @llvm.vector.reduce.or.v2i16(<2 x i16> undef)
99*46829e54SLiqinWeng; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V4 = call i16 @llvm.vector.reduce.or.v4i16(<4 x i16> undef)
100*46829e54SLiqinWeng; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V8 = call i16 @llvm.vector.reduce.or.v8i16(<8 x i16> undef)
101*46829e54SLiqinWeng; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V16 = call i16 @llvm.vector.reduce.or.v16i16(<16 x i16> undef)
102*46829e54SLiqinWeng; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V32 = call i16 @llvm.vector.reduce.or.v32i16(<32 x i16> undef)
103*46829e54SLiqinWeng; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V64 = call i16 @llvm.vector.reduce.or.v64i16(<64 x i16> undef)
104*46829e54SLiqinWeng; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %V128 = call i16 @llvm.vector.reduce.or.v128i16(<128 x i16> undef)
105fb661e25SShihPo Hung; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 undef
106fb661e25SShihPo Hung;
107ae7c6647SYeting Kuo  %V1   = call i16 @llvm.vector.reduce.or.v1i16(<1 x i16> undef)
108ae7c6647SYeting Kuo  %V2   = call i16 @llvm.vector.reduce.or.v2i16(<2 x i16> undef)
109ae7c6647SYeting Kuo  %V4   = call i16 @llvm.vector.reduce.or.v4i16(<4 x i16> undef)
110ae7c6647SYeting Kuo  %V8   = call i16 @llvm.vector.reduce.or.v8i16(<8 x i16> undef)
111ae7c6647SYeting Kuo  %V16  = call i16 @llvm.vector.reduce.or.v16i16(<16 x i16> undef)
112ae7c6647SYeting Kuo  %V32  = call i16 @llvm.vector.reduce.or.v32i16(<32 x i16> undef)
113ae7c6647SYeting Kuo  %V64  = call i16 @llvm.vector.reduce.or.v64i16(<64 x i16> undef)
114ae7c6647SYeting Kuo  %V128 = call i16 @llvm.vector.reduce.or.v128i16(<128 x i16> undef)
115ae7c6647SYeting Kuo  ret i32 undef
116ae7c6647SYeting Kuo}
117ae7c6647SYeting Kuo
118ae7c6647SYeting Kuodefine i32 @reduce_i32(i32 %arg) {
1192247e4deSPhilip Reames; CHECK-LABEL: 'reduce_i32'
120*46829e54SLiqinWeng; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V1 = call i32 @llvm.vector.reduce.or.v1i32(<1 x i32> undef)
121*46829e54SLiqinWeng; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i32 @llvm.vector.reduce.or.v2i32(<2 x i32> undef)
122*46829e54SLiqinWeng; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %V4 = call i32 @llvm.vector.reduce.or.v4i32(<4 x i32> undef)
123*46829e54SLiqinWeng; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V8 = call i32 @llvm.vector.reduce.or.v8i32(<8 x i32> undef)
124*46829e54SLiqinWeng; CHECK-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %V16 = call i32 @llvm.vector.reduce.or.v16i32(<16 x i32> undef)
125*46829e54SLiqinWeng; CHECK-NEXT:  Cost Model: Found an estimated cost of 6 for instruction: %V32 = call i32 @llvm.vector.reduce.or.v32i32(<32 x i32> undef)
126*46829e54SLiqinWeng; CHECK-NEXT:  Cost Model: Found an estimated cost of 14 for instruction: %V64 = call i32 @llvm.vector.reduce.or.v64i32(<64 x i32> undef)
127*46829e54SLiqinWeng; CHECK-NEXT:  Cost Model: Found an estimated cost of 30 for instruction: %V128 = call i32 @llvm.vector.reduce.or.v128i32(<128 x i32> undef)
1280a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
129ae7c6647SYeting Kuo;
130fb661e25SShihPo Hung; SIZE-LABEL: 'reduce_i32'
131*46829e54SLiqinWeng; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V1 = call i32 @llvm.vector.reduce.or.v1i32(<1 x i32> undef)
132*46829e54SLiqinWeng; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i32 @llvm.vector.reduce.or.v2i32(<2 x i32> undef)
133*46829e54SLiqinWeng; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V4 = call i32 @llvm.vector.reduce.or.v4i32(<4 x i32> undef)
134*46829e54SLiqinWeng; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V8 = call i32 @llvm.vector.reduce.or.v8i32(<8 x i32> undef)
135*46829e54SLiqinWeng; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V16 = call i32 @llvm.vector.reduce.or.v16i32(<16 x i32> undef)
136*46829e54SLiqinWeng; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V32 = call i32 @llvm.vector.reduce.or.v32i32(<32 x i32> undef)
137*46829e54SLiqinWeng; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %V64 = call i32 @llvm.vector.reduce.or.v64i32(<64 x i32> undef)
138*46829e54SLiqinWeng; SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %V128 = call i32 @llvm.vector.reduce.or.v128i32(<128 x i32> undef)
139fb661e25SShihPo Hung; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 undef
140fb661e25SShihPo Hung;
141ae7c6647SYeting Kuo  %V1   = call i32 @llvm.vector.reduce.or.v1i32(<1 x i32> undef)
142ae7c6647SYeting Kuo  %V2   = call i32 @llvm.vector.reduce.or.v2i32(<2 x i32> undef)
143ae7c6647SYeting Kuo  %V4   = call i32 @llvm.vector.reduce.or.v4i32(<4 x i32> undef)
144ae7c6647SYeting Kuo  %V8   = call i32 @llvm.vector.reduce.or.v8i32(<8 x i32> undef)
145ae7c6647SYeting Kuo  %V16  = call i32 @llvm.vector.reduce.or.v16i32(<16 x i32> undef)
146ae7c6647SYeting Kuo  %V32  = call i32 @llvm.vector.reduce.or.v32i32(<32 x i32> undef)
147ae7c6647SYeting Kuo  %V64  = call i32 @llvm.vector.reduce.or.v64i32(<64 x i32> undef)
148ae7c6647SYeting Kuo  %V128 = call i32 @llvm.vector.reduce.or.v128i32(<128 x i32> undef)
149ae7c6647SYeting Kuo  ret i32 undef
150ae7c6647SYeting Kuo}
151ae7c6647SYeting Kuo
152ae7c6647SYeting Kuodefine i32 @reduce_i64(i32 %arg) {
1532247e4deSPhilip Reames; CHECK-LABEL: 'reduce_i64'
154*46829e54SLiqinWeng; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %V1 = call i64 @llvm.vector.reduce.or.v1i64(<1 x i64> undef)
155*46829e54SLiqinWeng; CHECK-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i64 @llvm.vector.reduce.or.v2i64(<2 x i64> undef)
156*46829e54SLiqinWeng; CHECK-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %V4 = call i64 @llvm.vector.reduce.or.v4i64(<4 x i64> undef)
157*46829e54SLiqinWeng; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V8 = call i64 @llvm.vector.reduce.or.v8i64(<8 x i64> undef)
158*46829e54SLiqinWeng; CHECK-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %V16 = call i64 @llvm.vector.reduce.or.v16i64(<16 x i64> undef)
159*46829e54SLiqinWeng; CHECK-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %V32 = call i64 @llvm.vector.reduce.or.v32i64(<32 x i64> undef)
160*46829e54SLiqinWeng; CHECK-NEXT:  Cost Model: Found an estimated cost of 29 for instruction: %V64 = call i64 @llvm.vector.reduce.or.v64i64(<64 x i64> undef)
161*46829e54SLiqinWeng; CHECK-NEXT:  Cost Model: Found an estimated cost of 61 for instruction: %V128 = call i64 @llvm.vector.reduce.or.v128i64(<128 x i64> undef)
1620a5d52a7SSergey Kachkov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
163ae7c6647SYeting Kuo;
164fb661e25SShihPo Hung; SIZE-LABEL: 'reduce_i64'
165*46829e54SLiqinWeng; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V1 = call i64 @llvm.vector.reduce.or.v1i64(<1 x i64> undef)
166*46829e54SLiqinWeng; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V2 = call i64 @llvm.vector.reduce.or.v2i64(<2 x i64> undef)
167*46829e54SLiqinWeng; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V4 = call i64 @llvm.vector.reduce.or.v4i64(<4 x i64> undef)
168*46829e54SLiqinWeng; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V8 = call i64 @llvm.vector.reduce.or.v8i64(<8 x i64> undef)
169*46829e54SLiqinWeng; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %V16 = call i64 @llvm.vector.reduce.or.v16i64(<16 x i64> undef)
170*46829e54SLiqinWeng; SIZE-NEXT:  Cost Model: Found an estimated cost of 3 for instruction: %V32 = call i64 @llvm.vector.reduce.or.v32i64(<32 x i64> undef)
171*46829e54SLiqinWeng; SIZE-NEXT:  Cost Model: Found an estimated cost of 5 for instruction: %V64 = call i64 @llvm.vector.reduce.or.v64i64(<64 x i64> undef)
172*46829e54SLiqinWeng; SIZE-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %V128 = call i64 @llvm.vector.reduce.or.v128i64(<128 x i64> undef)
173fb661e25SShihPo Hung; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 undef
174fb661e25SShihPo Hung;
175ae7c6647SYeting Kuo  %V1   = call i64 @llvm.vector.reduce.or.v1i64(<1 x i64> undef)
176ae7c6647SYeting Kuo  %V2   = call i64 @llvm.vector.reduce.or.v2i64(<2 x i64> undef)
177ae7c6647SYeting Kuo  %V4   = call i64 @llvm.vector.reduce.or.v4i64(<4 x i64> undef)
178ae7c6647SYeting Kuo  %V8   = call i64 @llvm.vector.reduce.or.v8i64(<8 x i64> undef)
179ae7c6647SYeting Kuo  %V16  = call i64 @llvm.vector.reduce.or.v16i64(<16 x i64> undef)
180ae7c6647SYeting Kuo  %V32  = call i64 @llvm.vector.reduce.or.v32i64(<32 x i64> undef)
181ae7c6647SYeting Kuo  %V64  = call i64 @llvm.vector.reduce.or.v64i64(<64 x i64> undef)
182ae7c6647SYeting Kuo  %V128 = call i64 @llvm.vector.reduce.or.v128i64(<128 x i64> undef)
183ae7c6647SYeting Kuo  ret i32 undef
184ae7c6647SYeting Kuo}
185ae7c6647SYeting Kuo
18660470ac7SAlexey Bataevdeclare i1 @llvm.vector.reduce.or.v1i1(<1 x i1>)
18760470ac7SAlexey Bataevdeclare i1 @llvm.vector.reduce.or.v2i1(<2 x i1>)
18860470ac7SAlexey Bataevdeclare i1 @llvm.vector.reduce.or.v4i1(<4 x i1>)
18960470ac7SAlexey Bataevdeclare i1 @llvm.vector.reduce.or.v8i1(<8 x i1>)
19060470ac7SAlexey Bataevdeclare i1 @llvm.vector.reduce.or.v16i1(<16 x i1>)
19160470ac7SAlexey Bataevdeclare i1 @llvm.vector.reduce.or.v32i1(<32 x i1>)
19260470ac7SAlexey Bataevdeclare i1 @llvm.vector.reduce.or.v64i1(<64 x i1>)
19360470ac7SAlexey Bataevdeclare i1 @llvm.vector.reduce.or.v128i1(<128 x i1>)
194eb912411SPhilip Reamesdeclare i1 @llvm.vector.reduce.or.v256i1(<256 x i1>)
195eb912411SPhilip Reamesdeclare i1 @llvm.vector.reduce.or.v512i1(<512 x i1>)
196eb912411SPhilip Reamesdeclare i1 @llvm.vector.reduce.or.v1024i1(<1024 x i1>)
197ae7c6647SYeting Kuodeclare i8 @llvm.vector.reduce.or.v1i8(<1 x i8>)
198ae7c6647SYeting Kuodeclare i8 @llvm.vector.reduce.or.v2i8(<2 x i8>)
199ae7c6647SYeting Kuodeclare i8 @llvm.vector.reduce.or.v4i8(<4 x i8>)
200ae7c6647SYeting Kuodeclare i8 @llvm.vector.reduce.or.v8i8(<8 x i8>)
201ae7c6647SYeting Kuodeclare i8 @llvm.vector.reduce.or.v16i8(<16 x i8>)
202ae7c6647SYeting Kuodeclare i8 @llvm.vector.reduce.or.v32i8(<32 x i8>)
203ae7c6647SYeting Kuodeclare i8 @llvm.vector.reduce.or.v64i8(<64 x i8>)
204ae7c6647SYeting Kuodeclare i8 @llvm.vector.reduce.or.v128i8(<128 x i8>)
205ae7c6647SYeting Kuodeclare i16 @llvm.vector.reduce.or.v1i16(<1 x i16>)
206ae7c6647SYeting Kuodeclare i16 @llvm.vector.reduce.or.v2i16(<2 x i16>)
207ae7c6647SYeting Kuodeclare i16 @llvm.vector.reduce.or.v4i16(<4 x i16>)
208ae7c6647SYeting Kuodeclare i16 @llvm.vector.reduce.or.v8i16(<8 x i16>)
209ae7c6647SYeting Kuodeclare i16 @llvm.vector.reduce.or.v16i16(<16 x i16>)
210ae7c6647SYeting Kuodeclare i16 @llvm.vector.reduce.or.v32i16(<32 x i16>)
211ae7c6647SYeting Kuodeclare i16 @llvm.vector.reduce.or.v64i16(<64 x i16>)
212ae7c6647SYeting Kuodeclare i16 @llvm.vector.reduce.or.v128i16(<128 x i16>)
213ae7c6647SYeting Kuodeclare i32 @llvm.vector.reduce.or.v1i32(<1 x i32>)
214ae7c6647SYeting Kuodeclare i32 @llvm.vector.reduce.or.v2i32(<2 x i32>)
215ae7c6647SYeting Kuodeclare i32 @llvm.vector.reduce.or.v4i32(<4 x i32>)
216ae7c6647SYeting Kuodeclare i32 @llvm.vector.reduce.or.v8i32(<8 x i32>)
217ae7c6647SYeting Kuodeclare i32 @llvm.vector.reduce.or.v16i32(<16 x i32>)
218ae7c6647SYeting Kuodeclare i32 @llvm.vector.reduce.or.v32i32(<32 x i32>)
219ae7c6647SYeting Kuodeclare i32 @llvm.vector.reduce.or.v64i32(<64 x i32>)
220ae7c6647SYeting Kuodeclare i32 @llvm.vector.reduce.or.v128i32(<128 x i32>)
221ae7c6647SYeting Kuodeclare i64 @llvm.vector.reduce.or.v1i64(<1 x i64>)
222ae7c6647SYeting Kuodeclare i64 @llvm.vector.reduce.or.v2i64(<2 x i64>)
223ae7c6647SYeting Kuodeclare i64 @llvm.vector.reduce.or.v4i64(<4 x i64>)
224ae7c6647SYeting Kuodeclare i64 @llvm.vector.reduce.or.v8i64(<8 x i64>)
225ae7c6647SYeting Kuodeclare i64 @llvm.vector.reduce.or.v16i64(<16 x i64>)
226ae7c6647SYeting Kuodeclare i64 @llvm.vector.reduce.or.v32i64(<32 x i64>)
227ae7c6647SYeting Kuodeclare i64 @llvm.vector.reduce.or.v64i64(<64 x i64>)
228ae7c6647SYeting Kuodeclare i64 @llvm.vector.reduce.or.v128i64(<128 x i64>)
229