Skip to content

Commit 93f54fa

Browse files
[NFC] Remove the -instcombine flag from strict-fadd.ll
This also fixes a CHECK line in @fadd_strict_unroll which ensures the changes made to fixReduction() to support in-order reductions with unrolling are being tested correctly.
1 parent 2418554 commit 93f54fa

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

llvm/test/Transforms/LoopVectorize/AArch64/strict-fadd.ll

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: opt < %s -loop-vectorize -instcombine -mtriple aarch64-unknown-linux-gnu -enable-strict-reductions -S | FileCheck %s -check-prefix=CHECK
1+
; RUN: opt < %s -loop-vectorize -mtriple aarch64-unknown-linux-gnu -enable-strict-reductions -S | FileCheck %s -check-prefix=CHECK
22

33
define float @fadd_strict(float* noalias nocapture readonly %a, i64 %n) {
44
; CHECK-LABEL: @fadd_strict
@@ -30,14 +30,17 @@ define float @fadd_strict_unroll(float* noalias nocapture readonly %a, i64 %n) {
3030
; CHECK-LABEL: @fadd_strict_unroll
3131
; CHECK: vector.body:
3232
; CHECK: %[[VEC_PHI1:.*]] = phi float [ 0.000000e+00, %vector.ph ], [ %[[RDX4:.*]], %vector.body ]
33+
; CHECK: %[[VEC_PHI2:.*]] = phi float [ -0.000000e+00, %vector.ph ], [ %[[RDX4]], %vector.body ]
34+
; CHECK: %[[VEC_PHI3:.*]] = phi float [ -0.000000e+00, %vector.ph ], [ %[[RDX4]], %vector.body ]
35+
; CHECK: %[[VEC_PHI4:.*]] = phi float [ -0.000000e+00, %vector.ph ], [ %[[RDX4]], %vector.body ]
3336
; CHECK: %[[LOAD1:.*]] = load <8 x float>, <8 x float>*
3437
; CHECK: %[[LOAD2:.*]] = load <8 x float>, <8 x float>*
3538
; CHECK: %[[LOAD3:.*]] = load <8 x float>, <8 x float>*
3639
; CHECK: %[[LOAD4:.*]] = load <8 x float>, <8 x float>*
3740
; CHECK: %[[RDX1:.*]] = call float @llvm.vector.reduce.fadd.v8f32(float %[[VEC_PHI1]], <8 x float> %[[LOAD1]])
3841
; CHECK: %[[RDX2:.*]] = call float @llvm.vector.reduce.fadd.v8f32(float %[[RDX1]], <8 x float> %[[LOAD2]])
3942
; CHECK: %[[RDX3:.*]] = call float @llvm.vector.reduce.fadd.v8f32(float %[[RDX2]], <8 x float> %[[LOAD3]])
40-
; CHECK: %[[RDX4:.*]] = call float @llvm.vector.reduce.fadd.v8f32(float %[[RDX3]], <8 x float> %[[LOAD4]])
43+
; CHECK: %[[RDX4]] = call float @llvm.vector.reduce.fadd.v8f32(float %[[RDX3]], <8 x float> %[[LOAD4]])
4144
; CHECK: for.end
4245
; CHECK: %[[PHI:.*]] = phi float [ %[[SCALAR:.*]], %for.body ], [ %[[RDX4]], %middle.block ]
4346
; CHECK: ret float %[[PHI]]
@@ -148,7 +151,8 @@ define float @fadd_conditional(float* noalias nocapture readonly %a, float* noal
148151
; CHECK: br i1 %[[EXTRACT]], label %pred.load.if, label %pred.load.continue
149152
; CHECK: pred.load.continue6
150153
; CHECK: %[[PHI1:.*]] = phi <4 x float> [ %[[PHI0:.*]], %pred.load.continue4 ], [ %[[INS_ELT:.*]], %pred.load.if5 ]
151-
; CHECK: %[[PRED:.*]] = select <4 x i1> %[[FCMP1]], <4 x float> %[[PHI1]], <4 x float> <float 3.000000e+00, float 3.000000e+00, float 3.000000e+00, float 3.000000e+00>
154+
; CHECK: %[[XOR:.*]] = xor <4 x i1> %[[FCMP1]], <i1 true, i1 true, i1 true, i1 true>
155+
; CHECK: %[[PRED:.*]] = select <4 x i1> %[[XOR]], <4 x float> <float 3.000000e+00, float 3.000000e+00, float 3.000000e+00, float 3.000000e+00>, <4 x float> %[[PHI1]]
152156
; CHECK: %[[RDX]] = call float @llvm.vector.reduce.fadd.v4f32(float %[[PHI]], <4 x float> %[[PRED]])
153157
; CHECK: for.body
154158
; CHECK: %[[RES_PHI:.*]] = phi float [ %[[MERGE_RDX:.*]], %scalar.ph ], [ %[[FADD:.*]], %for.inc ]
@@ -196,7 +200,7 @@ for.end:
196200
define float @fadd_predicated(float* noalias nocapture %a, i64 %n) {
197201
; CHECK-LABEL: @fadd_predicated
198202
; CHECK: vector.ph
199-
; CHECK: %[[TRIP_MINUS_ONE:.*]] = add i64 %n, -1
203+
; CHECK: %[[TRIP_MINUS_ONE:.*]] = sub i64 %n, 1
200204
; CHECK: %[[BROADCAST_INS:.*]] = insertelement <2 x i64> poison, i64 %[[TRIP_MINUS_ONE]], i32 0
201205
; CHECK: %[[SPLAT:.*]] = shufflevector <2 x i64> %[[BROADCAST_INS]], <2 x i64> poison, <2 x i32> zeroinitializer
202206
; CHECK: vector.body
@@ -206,7 +210,7 @@ define float @fadd_predicated(float* noalias nocapture %a, i64 %n) {
206210
; CHECK: %[[MASK:.*]] = select <2 x i1> %0, <2 x float> %[[PHI]], <2 x float> <float -0.000000e+00, float -0.000000e+00>
207211
; CHECK: %[[RDX]] = call float @llvm.vector.reduce.fadd.v2f32(float %[[RDX_PHI]], <2 x float> %[[MASK]])
208212
; CHECK: for.end:
209-
; CHECK: %[[RES_PHI:.*]] = phi float [ undef, %for.body ], [ %[[RDX]], %middle.block ]
213+
; CHECK: %[[RES_PHI:.*]] = phi float [ %[[FADD:.*]], %for.body ], [ %[[RDX]], %middle.block ]
210214
; CHECK: ret float %[[RES_PHI]]
211215
entry:
212216
br label %for.body

0 commit comments

Comments
 (0)