[llvm] [VPlan] Add simple driver option to run some individual transforms. (PR #178522)

Andrei Elovikov via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 29 14:51:43 PST 2026


================
@@ -9753,6 +9761,19 @@ bool LoopVectorizePass::processLoop(Loop *L) {
 
   PredicatedScalarEvolution PSE(*SE, *L);
 
+  // VPlan test transform mode: build minimal VPlan and run requested
+  // transforms.
+  if (!VPlanTestTransform.empty()) {
+    auto Plan = VPlanTransforms::buildVPlan0(
+        L, *LI, Type::getInt64Ty(F->getContext()), DebugLoc(), PSE);
+    VPlanTransforms::handleEarlyExits(*Plan, /*HasUncountableExit=*/false);
+    VPlanTransforms::addMiddleCheck(*Plan, /*RequiresScalarEpilogueCheck=*/true,
+                                    /*TailFolded=*/false);
+    VPlanTransforms::createLoopRegions(*Plan);
----------------
eas wrote:

Do we really need to make those unconditional? Maybe have an aggregate transformation to simplify
"RUN" lines if that particular combination is needed often, but still allow to write a test targeting, e.g., `createLoopRegions` on its own.

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


More information about the llvm-commits mailing list