From: Jon Roelofs Date: Mon, 27 Jul 2020 18:34:36 +0000 (-0600) Subject: [OldPM] Print out a bit more when passes lie about changing IR X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=736423af53d707e097a174c3a91b75132b8dc6b1;p=platform%2Fupstream%2Fllvm.git [OldPM] Print out a bit more when passes lie about changing IR https://reviews.llvm.org/D84686 --- diff --git a/llvm/lib/IR/LegacyPassManager.cpp b/llvm/lib/IR/LegacyPassManager.cpp index c01696e..96434ae 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) {