[PATCH] D84686: [OldPM] Print out a bit more when passes lie about changing IR
Jon Roelofs via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 27 11:37:35 PDT 2020
jroelofs created this revision.
jroelofs added a reviewer: serge-sans-paille.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D84686
Files:
llvm/lib/IR/LegacyPassManager.cpp
Index: llvm/lib/IR/LegacyPassManager.cpp
===================================================================
--- llvm/lib/IR/LegacyPassManager.cpp
+++ llvm/lib/IR/LegacyPassManager.cpp
@@ -1586,9 +1586,12 @@
#endif
LocalChanged |= FP->runOnFunction(F);
-#ifdef EXPENSIVE_CHECKS
- assert((LocalChanged || (RefHash == StructuralHash(F))) &&
- "Pass modifies its input and doesn't report it.");
+#if defined(EXPENSIVE_CHECKS) && !defined(NDEBUG)
+ if (!LocalChanged && (RefHash != StructuralHash(F))) {
+ llvm::errs() << "Pass modifies its input and doesn't report it: "
+ << FP->getPassName() << "\n";
+ assert(false && "Pass modifies its input and doesn't report it.");
+ }
#endif
if (EmitICRemark) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84686.280994.patch
Type: text/x-patch
Size: 781 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200727/41721f91/attachment.bin>
More information about the llvm-commits
mailing list