mirror of
https://github.com/intel/llvm.git
synced 2026-01-14 03:50:17 +08:00
[BOLT] Do no report error on mismatched instruction encoding
Summary: When the validation of instruction encoding fails but we are able to continue processing the binary, do no report an error. Report encoding format only under `-v=1`. (cherry picked from FBD19376531)
This commit is contained in:
@@ -1851,9 +1851,11 @@ bool BinaryContext::validateEncoding(const MCInst &Inst,
|
||||
MCE->encodeInstruction(Inst, VecOS, Fixups, *STI);
|
||||
auto EncodedData = ArrayRef<uint8_t>((uint8_t *)Code.data(), Code.size());
|
||||
if (InputEncoding != EncodedData) {
|
||||
errs() << "BOLT-ERROR: mismatched encoding detected\n"
|
||||
<< " input: " << InputEncoding << '\n'
|
||||
<< " output: " << EncodedData << '\n';
|
||||
if (opts::Verbosity > 1) {
|
||||
errs() << "BOLT-WARNING: mismatched encoding detected\n"
|
||||
<< " input: " << InputEncoding << '\n'
|
||||
<< " output: " << EncodedData << '\n';
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user