diff --git a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp index 04513b8d8d10..4e9be35001ad 100644 --- a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp +++ b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp @@ -49,6 +49,7 @@ bool VPRecipeBase::mayWriteToMemory() const { return cast(getVPSingleValue()->getUnderlyingValue()) ->mayWriteToMemory(); case VPBranchOnMaskSC: + case VPScalarIVStepsSC: return false; case VPWidenIntOrFpInductionSC: case VPWidenCanonicalIVSC: @@ -80,6 +81,7 @@ bool VPRecipeBase::mayReadFromMemory() const { return cast(getVPSingleValue()->getUnderlyingValue()) ->mayReadFromMemory(); case VPBranchOnMaskSC: + case VPScalarIVStepsSC: return false; case VPWidenIntOrFpInductionSC: case VPWidenCanonicalIVSC: diff --git a/llvm/unittests/Transforms/Vectorize/VPlanTest.cpp b/llvm/unittests/Transforms/Vectorize/VPlanTest.cpp index 34522ad607d7..d4c12eb3fab5 100644 --- a/llvm/unittests/Transforms/Vectorize/VPlanTest.cpp +++ b/llvm/unittests/Transforms/Vectorize/VPlanTest.cpp @@ -1080,9 +1080,9 @@ TEST(VPRecipeTest, MayHaveSideEffectsAndMayReadWriteMemory) { InductionDescriptor IndDesc; VPScalarIVStepsRecipe Recipe(IndDesc, &Op1, &Op2); EXPECT_FALSE(Recipe.mayHaveSideEffects()); - EXPECT_TRUE(Recipe.mayReadFromMemory()); - EXPECT_TRUE(Recipe.mayWriteToMemory()); - EXPECT_TRUE(Recipe.mayReadOrWriteMemory()); + EXPECT_FALSE(Recipe.mayReadFromMemory()); + EXPECT_FALSE(Recipe.mayWriteToMemory()); + EXPECT_FALSE(Recipe.mayReadOrWriteMemory()); } // The initial implementation is conservative with respect to VPInstructions.