forked from OSchip/llvm-project
[AArch64] Improve the readability of the ld/st optimization pass. NFC.
In this context, MI is an add/sub instruction not a loads/store. llvm-svn: 248540
This commit is contained in:
parent
7d0c7255c5
commit
b02f5a5a1f
|
@ -750,10 +750,10 @@ static bool isMatchingUpdateInsn(MachineInstr *MI, unsigned BaseReg,
|
|||
break;
|
||||
// If the instruction has the base register as source and dest and the
|
||||
// immediate will fit in a signed 9-bit integer, then we have a match.
|
||||
if (getLdStRegOp(MI).getReg() == BaseReg &&
|
||||
getLdStBaseOp(MI).getReg() == BaseReg &&
|
||||
getLdStOffsetOp(MI).getImm() <= 255 &&
|
||||
getLdStOffsetOp(MI).getImm() >= -256) {
|
||||
if (MI->getOperand(0).getReg() == BaseReg &&
|
||||
MI->getOperand(1).getReg() == BaseReg &&
|
||||
MI->getOperand(2).getImm() <= 255 &&
|
||||
MI->getOperand(2).getImm() >= -256) {
|
||||
// If we have a non-zero Offset, we check that it matches the amount
|
||||
// we're adding to the register.
|
||||
if (!Offset || Offset == MI->getOperand(2).getImm())
|
||||
|
|
Loading…
Reference in New Issue