[VPlan] Mark VPScalarIVStepsRecipe as not reading/writing memory.
The recipe only computes the inductions steps using its operands. It does neither read nor write memory. Split of from D133760.
This commit is contained in:
parent
cf28e6b2f1
commit
3c5f07349f
|
@ -49,6 +49,7 @@ bool VPRecipeBase::mayWriteToMemory() const {
|
||||||
return cast<Instruction>(getVPSingleValue()->getUnderlyingValue())
|
return cast<Instruction>(getVPSingleValue()->getUnderlyingValue())
|
||||||
->mayWriteToMemory();
|
->mayWriteToMemory();
|
||||||
case VPBranchOnMaskSC:
|
case VPBranchOnMaskSC:
|
||||||
|
case VPScalarIVStepsSC:
|
||||||
return false;
|
return false;
|
||||||
case VPWidenIntOrFpInductionSC:
|
case VPWidenIntOrFpInductionSC:
|
||||||
case VPWidenCanonicalIVSC:
|
case VPWidenCanonicalIVSC:
|
||||||
|
@ -80,6 +81,7 @@ bool VPRecipeBase::mayReadFromMemory() const {
|
||||||
return cast<Instruction>(getVPSingleValue()->getUnderlyingValue())
|
return cast<Instruction>(getVPSingleValue()->getUnderlyingValue())
|
||||||
->mayReadFromMemory();
|
->mayReadFromMemory();
|
||||||
case VPBranchOnMaskSC:
|
case VPBranchOnMaskSC:
|
||||||
|
case VPScalarIVStepsSC:
|
||||||
return false;
|
return false;
|
||||||
case VPWidenIntOrFpInductionSC:
|
case VPWidenIntOrFpInductionSC:
|
||||||
case VPWidenCanonicalIVSC:
|
case VPWidenCanonicalIVSC:
|
||||||
|
|
|
@ -1080,9 +1080,9 @@ TEST(VPRecipeTest, MayHaveSideEffectsAndMayReadWriteMemory) {
|
||||||
InductionDescriptor IndDesc;
|
InductionDescriptor IndDesc;
|
||||||
VPScalarIVStepsRecipe Recipe(IndDesc, &Op1, &Op2);
|
VPScalarIVStepsRecipe Recipe(IndDesc, &Op1, &Op2);
|
||||||
EXPECT_FALSE(Recipe.mayHaveSideEffects());
|
EXPECT_FALSE(Recipe.mayHaveSideEffects());
|
||||||
EXPECT_TRUE(Recipe.mayReadFromMemory());
|
EXPECT_FALSE(Recipe.mayReadFromMemory());
|
||||||
EXPECT_TRUE(Recipe.mayWriteToMemory());
|
EXPECT_FALSE(Recipe.mayWriteToMemory());
|
||||||
EXPECT_TRUE(Recipe.mayReadOrWriteMemory());
|
EXPECT_FALSE(Recipe.mayReadOrWriteMemory());
|
||||||
}
|
}
|
||||||
|
|
||||||
// The initial implementation is conservative with respect to VPInstructions.
|
// The initial implementation is conservative with respect to VPInstructions.
|
||||||
|
|
Loading…
Reference in New Issue