[VPlan] Add sideeffect/memory unit test for VPScalarIVStepsRecipe. (NFC)
authorFlorian Hahn <flo@fhahn.com>
Sun, 4 Dec 2022 12:50:09 +0000 (12:50 +0000)
committerFlorian Hahn <flo@fhahn.com>
Sun, 4 Dec 2022 12:50:09 +0000 (12:50 +0000)
llvm/unittests/Transforms/Vectorize/VPlanTest.cpp

index ff9eee0..34522ad 100644 (file)
@@ -1074,6 +1074,17 @@ TEST(VPRecipeTest, MayHaveSideEffectsAndMayReadWriteMemory) {
     delete Call;
   }
 
+  {
+    VPValue Op1;
+    VPValue Op2;
+    InductionDescriptor IndDesc;
+    VPScalarIVStepsRecipe Recipe(IndDesc, &Op1, &Op2);
+    EXPECT_FALSE(Recipe.mayHaveSideEffects());
+    EXPECT_TRUE(Recipe.mayReadFromMemory());
+    EXPECT_TRUE(Recipe.mayWriteToMemory());
+    EXPECT_TRUE(Recipe.mayReadOrWriteMemory());
+  }
+
   // The initial implementation is conservative with respect to VPInstructions.
   {
     VPValue Op1;