[llvm] 736423a - [OldPM] Print out a bit more when passes lie about changing IR
Jon Roelofs via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 28 09:01:36 PDT 2020
Author: Jon Roelofs
Date: 2020-07-28T10:01:24-06:00
New Revision: 736423af53d707e097a174c3a91b75132b8dc6b1
URL: https://github.com/llvm/llvm-project/commit/736423af53d707e097a174c3a91b75132b8dc6b1
DIFF: https://github.com/llvm/llvm-project/commit/736423af53d707e097a174c3a91b75132b8dc6b1.diff
LOG: [OldPM] Print out a bit more when passes lie about changing IR
https://reviews.llvm.org/D84686
Added:
Modified:
llvm/lib/IR/LegacyPassManager.cpp
Removed:
################################################################################
diff --git a/llvm/lib/IR/LegacyPassManager.cpp b/llvm/lib/IR/LegacyPassManager.cpp
index c01696e4e575..96434ae3306b 100644
--- a/llvm/lib/IR/LegacyPassManager.cpp
+++ b/llvm/lib/IR/LegacyPassManager.cpp
@@ -1586,9 +1586,12 @@ bool FPPassManager::runOnFunction(Function &F) {
#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) {
More information about the llvm-commits
mailing list