https://reviews.llvm.org/D84686
#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) {