Teach isCSRestore() that ARM/Thumb2 functions will use post-modify LDR

instructions to restore a single register rather than an LDM instruction.
rdar://8754999

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121498 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jim Grosbach 2010-12-10 18:41:15 +00:00
parent c9672cb8be
commit 568f528c99

View File

@ -92,6 +92,11 @@ static bool isCSRestore(MachineInstr *MI,
return false;
return true;
}
if ((MI->getOpcode() == ARM::LDR_POST ||
MI->getOpcode() == ARM::t2LDR_POST) &&
isCalleeSavedRegister(MI->getOperand(0).getReg(), CSRegs) &&
MI->getOperand(1).getReg() == ARM::SP)
return true;
return false;
}