[llvm] [VPlan] Tighten m_CanonicalIV() (PR #194312)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 27 02:38:09 PDT 2026


================
@@ -50,6 +50,21 @@ TEST_F(VPPatternMatchTest, ScalarIVSteps) {
                                             m_Specific(VF))));
 }
 
+TEST_F(VPPatternMatchTest, CanonicalIV) {
+  VPlan &Plan = getPlan();
+  IntegerType *I64Ty = IntegerType::get(C, 64);
+  VPRegionBlock *VPR =
+      Plan.createLoopRegion(I64Ty, DebugLoc::getCompilerGenerated());
+  VPValue *CanIV = VPR->getCanonicalIV();
+
+  using namespace VPlanPatternMatch;
----------------
fhahn wrote:

somewhat independent, but should be possible to hoist this out and remove local `  using namespace VPlanPatternMatch;` in other tests

https://github.com/llvm/llvm-project/pull/194312


More information about the llvm-commits mailing list