diff --git a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp index 8c09b2fa9d15e..34981111c85e5 100644 --- a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp +++ b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp @@ -83,6 +83,7 @@ bool VPRecipeBase::mayReadFromMemory() const { ->mayReadFromMemory(); case VPBranchOnMaskSC: case VPScalarIVStepsSC: + case VPPredInstPHISC: return false; case VPWidenIntOrFpInductionSC: case VPWidenCanonicalIVSC: diff --git a/llvm/unittests/Transforms/Vectorize/VPlanTest.cpp b/llvm/unittests/Transforms/Vectorize/VPlanTest.cpp index 015f1f98f2eff..a8797994bc93b 100644 --- a/llvm/unittests/Transforms/Vectorize/VPlanTest.cpp +++ b/llvm/unittests/Transforms/Vectorize/VPlanTest.cpp @@ -1165,9 +1165,9 @@ TEST(VPRecipeTest, MayHaveSideEffectsAndMayReadWriteMemory) { VPValue Op1; VPPredInstPHIRecipe Recipe(&Op1); EXPECT_FALSE(Recipe.mayHaveSideEffects()); - EXPECT_TRUE(Recipe.mayReadFromMemory()); + EXPECT_FALSE(Recipe.mayReadFromMemory()); EXPECT_FALSE(Recipe.mayWriteToMemory()); - EXPECT_TRUE(Recipe.mayReadOrWriteMemory()); + EXPECT_FALSE(Recipe.mayReadOrWriteMemory()); } }