if (translate(Inst))
continue;
- std::string InstStrStorage;
- raw_string_ostream InstStr(InstStrStorage);
- InstStr << Inst;
-
OptimizationRemarkMissed R("gisel-irtranslator", "GISelFailure",
Inst.getDebugLoc(), &BB);
- R << "unable to translate instruction: " << ore::NV("Opcode", &Inst)
- << ": '" << InstStr.str() << "'";
+ R << "unable to translate instruction: " << ore::NV("Opcode", &Inst);
+
+ if (ORE->allowExtraAnalysis("gisel-irtranslator")) {
+ std::string InstStrStorage;
+ raw_string_ostream InstStr(InstStrStorage);
+ InstStr << Inst;
+
+ R << ": '" << InstStr.str() << "'";
+ }
+
reportTranslationError(*MF, *TPC, *ORE, R);
return false;
}
const MachineInstr &MI) {
MachineOptimizationRemarkMissed R(PassName, "GISelFailure: ",
MI.getDebugLoc(), MI.getParent());
- R << Msg << ": " << ore::MNV("Inst", MI);
+ R << Msg;
+ // Printing MI is expensive; only do it if expensive remarks are enabled.
+ if (MORE.allowExtraAnalysis(PassName))
+ R << ": " << ore::MNV("Inst", MI);
reportGISelFailure(MF, TPC, MORE, R);
}