[llvm] [VPlan][UTC] Number VPlan passes' instances in printing/filtering (PR #211424)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 17 09:29:45 PDT 2026


================
@@ -56,11 +56,26 @@ struct VPlanTransforms {
   static decltype(auto) runPass(StringRef PassName, PassTy &&Pass, VPlan &Plan,
                                 ArgsTy &&...Args) {
 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
+    static DenseMap<std::pair<Function *, StringRef /* Pass */>, unsigned>
+        PassCounter;
+    Function *Fn = Plan.getScalarHeader()->getIRBasicBlock()->getParent();
+    // Computing these is expensive, so only do it if any VPlan printing has
+    // been requested.
+    unsigned Instance;
+    std::string NumberedPassName;
+
+    if (VPlanPrintBeforeAll || VPlanPrintAfterAll ||
+        !VPlanPrintBeforePasses.empty() || !VPlanPrintAfterPasses.empty()) {
----------------
fhahn wrote:

If possible, it would probably be worth adding a test which passes `-vplan-print-after-all=false`/`-vplan-print-after=''`

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


More information about the llvm-commits mailing list