diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp --- a/llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp @@ -1020,8 +1020,7 @@ // reduction operations in-loop, and do not have intermediate store. return (all_of(getReductionVars(), [&](auto &Reduction) -> bool { const RecurrenceDescriptor &RdxDesc = Reduction.second; - return !RdxDesc.hasExactFPMath() || - (RdxDesc.isOrdered() && !RdxDesc.IntermediateStore); + return !RdxDesc.hasExactFPMath() || RdxDesc.isOrdered(); })); } diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/strict-fadd.ll b/llvm/test/Transforms/LoopVectorize/AArch64/strict-fadd.ll --- a/llvm/test/Transforms/LoopVectorize/AArch64/strict-fadd.ll +++ b/llvm/test/Transforms/LoopVectorize/AArch64/strict-fadd.ll @@ -1361,10 +1361,10 @@ ; Test case with invariant store where fadd is strict. define void @reduction_store_to_invariant_address(float* %dst, float* readonly %src) { ; CHECK-ORDERED-LABEL: @reduction_store_to_invariant_address( -; CHECK-ORDERED-NOT: vector.body +; CHECK-ORDERED: vector.body ; CHECK-UNORDERED-LABEL: @reduction_store_to_invariant_address( -; CHECK-UNORDERED-NOT: vector.body +; CHECK-UNORDERED: vector.body ; CHECK-NOT-VECTORIZED-LABEL: @reduction_store_to_invariant_address( ; CHECK-NOT-VECTORIZED-NOT: vector.body @@ -1383,7 +1383,7 @@ store float %add, float* %arrayidx, align 4 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond = icmp eq i64 %indvars.iv.next, 1000 - br i1 %exitcond, label %for.cond.cleanup, label %for.body + br i1 %exitcond, label %for.cond.cleanup, label %for.body, !llvm.loop !0 for.cond.cleanup: ret void