PPC::DBG_VALUE must use Reg+Imm frame-index elimination even for large offsets. Fixes PR12203.

I don't have a small test case yet, but I'll try to construct one.

llvm-svn: 153240
This commit is contained in:
Hal Finkel 2012-03-22 05:28:19 +00:00
parent 88c929ec53
commit 84b247a2ef

View File

@ -554,7 +554,8 @@ PPCRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
// clear can be encoded. This is extremely uncommon, because normally you // clear can be encoded. This is extremely uncommon, because normally you
// only "std" to a stack slot that is at least 4-byte aligned, but it can // only "std" to a stack slot that is at least 4-byte aligned, but it can
// happen in invalid code. // happen in invalid code.
if (isInt<16>(Offset) && (!isIXAddr || (Offset & 3) == 0)) { if (OpC == PPC::DBG_VALUE || // DBG_VALUE is always Reg+Imm
(isInt<16>(Offset) && (!isIXAddr || (Offset & 3) == 0))) {
if (isIXAddr) if (isIXAddr)
Offset >>= 2; // The actual encoded value has the low two bits zero. Offset >>= 2; // The actual encoded value has the low two bits zero.
MI.getOperand(OffsetOperandNo).ChangeToImmediate(Offset); MI.getOperand(OffsetOperandNo).ChangeToImmediate(Offset);