[llvm] [LV][NFC] Print VPlan's transformation pipline (PR #72665)

via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 17 07:38:52 PST 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-transforms

Author: Kolya Panchenko (nikolaypanchenko)

<details>
<summary>Changes</summary>

Print `VPlan` before each pass in `VPlanTransforms::optimize` with a debug type `vplan-xforms`.

---
Full diff: https://github.com/llvm/llvm-project/pull/72665.diff


1 Files Affected:

- (modified) llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp (+25) 


``````````diff
diff --git a/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp b/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
index 0eaaa037ad5782f..142cda07adbd763 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
@@ -24,6 +24,8 @@
 #include "llvm/IR/Intrinsics.h"
 #include "llvm/IR/PatternMatch.h"
 
+#define DEBUG_TYPE "vplan-xforms"
+
 using namespace llvm;
 
 using namespace llvm::PatternMatch;
@@ -871,16 +873,39 @@ static void simplifyRecipes(VPlan &Plan, LLVMContext &Ctx) {
 }
 
 void VPlanTransforms::optimize(VPlan &Plan, ScalarEvolution &SE) {
+  LLVM_DEBUG(dbgs() << "LV: --- VPlan before removeRedundantCanonicalIVs ---\n";
+             Plan.dump(); dbgs() << "\n\n");
   removeRedundantCanonicalIVs(Plan);
+
+  LLVM_DEBUG(
+      dbgs() << "LV: --- VPlan before removeRedundantInductionCasts ---\n";
+      Plan.dump(); dbgs() << "\n\n");
   removeRedundantInductionCasts(Plan);
 
+  LLVM_DEBUG(dbgs() << "LV: --- VPlan before optimizeInductions ---\n";
+             Plan.dump(); dbgs() << "\n\n");
   optimizeInductions(Plan, SE);
+
+  LLVM_DEBUG(dbgs() << "LV: --- VPlan before simplifyRecipes ---\n";
+             Plan.dump(); dbgs() << "\n\n");
   simplifyRecipes(Plan, SE.getContext());
+
+  LLVM_DEBUG(dbgs() << "LV: --- VPlan before removeDeadRecipes ---\n";
+             Plan.dump(); dbgs() << "\n\n");
   removeDeadRecipes(Plan);
 
+  LLVM_DEBUG(
+      dbgs() << "LV: --- VPlan before createAndOptimizeReplicateRegions ---\n";
+      Plan.dump(); dbgs() << "\n\n");
   createAndOptimizeReplicateRegions(Plan);
 
+  LLVM_DEBUG(
+      dbgs() << "LV: --- VPlan before removeRedundantExpandSCEVRecipes ---\n";
+      Plan.dump(); dbgs() << "\n\n");
   removeRedundantExpandSCEVRecipes(Plan);
+
+  LLVM_DEBUG(dbgs() << "LV: --- VPlan before mergeBlocksIntoPredecessors ---\n";
+             Plan.dump(); dbgs() << "\n\n");
   mergeBlocksIntoPredecessors(Plan);
 }
 

``````````

</details>


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


More information about the llvm-commits mailing list