forked from OSchip/llvm-project
Shorten instructions if possible.
Summary: Generate short versions of branch instructions by default and rely on relaxation to produce longer versions when needed. Also produce short versions of arithmetic instructions if immediate fits into one byte. This was only triggered once on HHVM binary. (cherry picked from FBD3591466)
This commit is contained in:
parent
674dbcc0de
commit
bf46263eed
|
@ -480,6 +480,9 @@ bool BinaryFunction::disassemble(ArrayRef<uint8_t> FunctionData) {
|
|||
break;
|
||||
}
|
||||
|
||||
// Convert instruction to a shorter version that could be relaxed if needed.
|
||||
MIA->shortenInstruction(Instruction);
|
||||
|
||||
if (MIA->isBranch(Instruction) || MIA->isCall(Instruction)) {
|
||||
uint64_t InstructionTarget = 0;
|
||||
if (MIA->evaluateBranch(Instruction,
|
||||
|
|
Loading…
Reference in New Issue