From 5368536cf1db183790461c9d9ab9fa96bfa536eb Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Mon, 30 Jan 2023 10:29:27 +0000 Subject: [PATCH] [VPlan] VPPredInstPHIRecipes does not write to memory. VPPredInstPHIRecipe just merges the incoming values and does not write to memory. --- llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp | 1 + llvm/unittests/Transforms/Vectorize/VPlanTest.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp index 4e9be35..8c09b2f 100644 --- a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp +++ b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp @@ -50,6 +50,7 @@ bool VPRecipeBase::mayWriteToMemory() const { ->mayWriteToMemory(); 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 377d607..015f1f9 100644 --- a/llvm/unittests/Transforms/Vectorize/VPlanTest.cpp +++ b/llvm/unittests/Transforms/Vectorize/VPlanTest.cpp @@ -1166,7 +1166,7 @@ TEST(VPRecipeTest, MayHaveSideEffectsAndMayReadWriteMemory) { VPPredInstPHIRecipe Recipe(&Op1); EXPECT_FALSE(Recipe.mayHaveSideEffects()); EXPECT_TRUE(Recipe.mayReadFromMemory()); - EXPECT_TRUE(Recipe.mayWriteToMemory()); + EXPECT_FALSE(Recipe.mayWriteToMemory()); EXPECT_TRUE(Recipe.mayReadOrWriteMemory()); } } -- 2.7.4