[OldPM] Print out a bit more when passes lie about changing IR

https://reviews.llvm.org/D84686
This commit is contained in:
Jon Roelofs 2020-07-27 12:34:36 -06:00
parent 97b5fb78d1
commit 736423af53
1 changed files with 6 additions and 3 deletions

View File

@ -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) {