1 ; RUN: opt -S < %s | FileCheck %s
2 ; RUN: llvm-dis < %s.bc | FileCheck %s
5 define float @fadd_v2(<4 x float> %in, float %acc) {
6 ; CHECK-LABEL: @fadd_v2
7 ; CHECK: %res = call float @llvm.vector.reduce.fadd.v4f32(float %acc, <4 x float> %in)
8 %res = call float @llvm.experimental.vector.reduce.v2.fadd.f32.v4f32(float %acc, <4 x float> %in)
12 define float @fadd_v2_fast(<4 x float> %in, float %acc) {
13 ; CHECK-LABEL: @fadd_v2_fast
14 ; CHECK: %res = call fast float @llvm.vector.reduce.fadd.v4f32(float %acc, <4 x float> %in)
15 %res = call fast float @llvm.experimental.vector.reduce.v2.fadd.f32.v4f32(float %acc, <4 x float> %in)
19 define float @fmul_v2(<4 x float> %in, float %acc) {
20 ; CHECK-LABEL: @fmul_v2
21 ; CHECK: %res = call float @llvm.vector.reduce.fmul.v4f32(float %acc, <4 x float> %in)
22 %res = call float @llvm.experimental.vector.reduce.v2.fmul.f32.v4f32(float %acc, <4 x float> %in)
26 define float @fmul_v2_fast(<4 x float> %in, float %acc) {
27 ; CHECK-LABEL: @fmul_v2_fast
28 ; CHECK: %res = call fast float @llvm.vector.reduce.fmul.v4f32(float %acc, <4 x float> %in)
29 %res = call fast float @llvm.experimental.vector.reduce.v2.fmul.f32.v4f32(float %acc, <4 x float> %in)
33 define float @fmin(<4 x float> %in) {
35 ; CHECK: %res = call float @llvm.vector.reduce.fmin.v4f32(<4 x float> %in)
36 %res = call float @llvm.experimental.vector.reduce.fmin.v4f32(<4 x float> %in)
40 define float @fmax(<4 x float> %in) {
42 ; CHECK: %res = call float @llvm.vector.reduce.fmax.v4f32(<4 x float> %in)
43 %res = call float @llvm.experimental.vector.reduce.fmax.v4f32(<4 x float> %in)
47 define i32 @and(<4 x i32> %in) {
49 ; CHECK: %res = call i32 @llvm.vector.reduce.and.v4i32(<4 x i32> %in)
50 %res = call i32 @llvm.experimental.vector.reduce.and.v4i32(<4 x i32> %in)
54 define i32 @or(<4 x i32> %in) {
56 ; CHECK: %res = call i32 @llvm.vector.reduce.or.v4i32(<4 x i32> %in)
57 %res = call i32 @llvm.experimental.vector.reduce.or.v4i32(<4 x i32> %in)
61 define i32 @xor(<4 x i32> %in) {
63 ; CHECK: %res = call i32 @llvm.vector.reduce.xor.v4i32(<4 x i32> %in)
64 %res = call i32 @llvm.experimental.vector.reduce.xor.v4i32(<4 x i32> %in)
68 define i32 @smin(<4 x i32> %in) {
70 ; CHECK: %res = call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %in)
71 %res = call i32 @llvm.experimental.vector.reduce.smin.v4i32(<4 x i32> %in)
75 define i32 @smax(<4 x i32> %in) {
77 ; CHECK: %res = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %in)
78 %res = call i32 @llvm.experimental.vector.reduce.smax.v4i32(<4 x i32> %in)
82 define i32 @umin(<4 x i32> %in) {
84 ; CHECK: %res = call i32 @llvm.vector.reduce.umin.v4i32(<4 x i32> %in)
85 %res = call i32 @llvm.experimental.vector.reduce.umin.v4i32(<4 x i32> %in)
89 define i32 @umax(<4 x i32> %in) {
91 ; CHECK: %res = call i32 @llvm.vector.reduce.umax.v4i32(<4 x i32> %in)
92 %res = call i32 @llvm.experimental.vector.reduce.umax.v4i32(<4 x i32> %in)
97 declare float @llvm.experimental.vector.reduce.v2.fadd.f32.v4f32(float, <4 x float>)
98 declare float @llvm.experimental.vector.reduce.v2.fmul.f32.v4f32(float, <4 x float>)
100 declare float @llvm.experimental.vector.reduce.fmin.v4f32(<4 x float>)
101 ; CHECK: declare float @llvm.vector.reduce.fmin.v4f32(<4 x float>)
103 declare float @llvm.experimental.vector.reduce.fmax.v4f32(<4 x float>)
104 ; CHECK: declare float @llvm.vector.reduce.fmax.v4f32(<4 x float>)
106 declare i32 @llvm.experimental.vector.reduce.and.v4i32(<4 x i32>)
107 ; CHECK: declare i32 @llvm.vector.reduce.and.v4i32(<4 x i32>)
109 declare i32 @llvm.experimental.vector.reduce.or.v4i32(<4 x i32>)
110 ; CHECK: declare i32 @llvm.vector.reduce.or.v4i32(<4 x i32>)
112 declare i32 @llvm.experimental.vector.reduce.xor.v4i32(<4 x i32>)
113 ; CHECK: declare i32 @llvm.vector.reduce.xor.v4i32(<4 x i32>)
115 declare i32 @llvm.experimental.vector.reduce.smin.v4i32(<4 x i32>)
116 ; CHECK: declare i32 @llvm.vector.reduce.smin.v4i32(<4 x i32>)
118 declare i32 @llvm.experimental.vector.reduce.smax.v4i32(<4 x i32>)
119 ; CHECK: declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>)
121 declare i32 @llvm.experimental.vector.reduce.umin.v4i32(<4 x i32>)
122 ; CHECK: declare i32 @llvm.vector.reduce.umin.v4i32(<4 x i32>)
124 declare i32 @llvm.experimental.vector.reduce.umax.v4i32(<4 x i32>)
125 ; CHECK: declare i32 @llvm.vector.reduce.umax.v4i32(<4 x i32>)