[llvm] Report pass name when -llvm-verify-each reports breakage (PR #71447)

via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 6 14:03:27 PST 2023


https://github.com/chrulski-intel created https://github.com/llvm/llvm-project/pull/71447

Update the string reported to include the pass name of last pass when running verifier after each pass.

>From c7a15dcfed077f95470eaa57833331a24d54fd3c Mon Sep 17 00:00:00 2001
From: chrulski-intel <christopher.m.chrulski at intel.com>
Date: Mon, 6 Nov 2023 09:39:33 -0800
Subject: [PATCH] Report pass name when -llvm-verify-each reports breakage

Update the string reported to include the pass name of last pass
when running verifier after each pass.
---
 llvm/lib/Passes/StandardInstrumentations.cpp | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/llvm/lib/Passes/StandardInstrumentations.cpp b/llvm/lib/Passes/StandardInstrumentations.cpp
index 06cc58c0219632d..556fdbb44620d90 100644
--- a/llvm/lib/Passes/StandardInstrumentations.cpp
+++ b/llvm/lib/Passes/StandardInstrumentations.cpp
@@ -1401,7 +1401,9 @@ void VerifyInstrumentation::registerCallbacks(
             dbgs() << "Verifying function " << F->getName() << "\n";
 
           if (verifyFunction(*F, &errs()))
-            report_fatal_error("Broken function found, compilation aborted!");
+            report_fatal_error(formatv("Broken function found after pass "
+                                       "\"{0}\", compilation aborted!",
+                                       P));
         } else {
           const Module **MPtr = llvm::any_cast<const Module *>(&IR);
           const Module *M = MPtr ? *MPtr : nullptr;
@@ -1416,7 +1418,9 @@ void VerifyInstrumentation::registerCallbacks(
               dbgs() << "Verifying module " << M->getName() << "\n";
 
             if (verifyModule(*M, &errs()))
-              report_fatal_error("Broken module found, compilation aborted!");
+              report_fatal_error(formatv("Broken module found after pass "
+                                         "\"{0}\", compilation aborted!",
+                                         P));
           }
         }
       });



More information about the llvm-commits mailing list