Do not lose the offset from teh global when peephole optimizing instructions.

This fixes FreeBench/pcompress


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19507 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2005-01-12 05:17:28 +00:00
parent 507bdf9488
commit a23ccfb124

View File

@ -198,9 +198,11 @@ bool PH::PeepholeOptimize(MachineBasicBlock &MBB,
addReg(R1).addSImm(Offset).addZImm((char)Val));
} else if (MI->getOperand(3).isGlobalAddress()) {
GlobalValue *GA = MI->getOperand(3).getGlobal();
int Offset = MI->getOperand(3).getOffset();
I = MBB.insert(MBB.erase(I),
BuildMI(Opcode, 5).addReg(R0).addZImm(Scale).
addReg(R1).addGlobalAddress(GA).addZImm((char)Val));
addReg(R1).addGlobalAddress(GA, false, Offset).
addZImm((char)Val));
}
return true;
}