mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
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:
parent
507bdf9488
commit
a23ccfb124
@ -198,9 +198,11 @@ bool PH::PeepholeOptimize(MachineBasicBlock &MBB,
|
|||||||
addReg(R1).addSImm(Offset).addZImm((char)Val));
|
addReg(R1).addSImm(Offset).addZImm((char)Val));
|
||||||
} else if (MI->getOperand(3).isGlobalAddress()) {
|
} else if (MI->getOperand(3).isGlobalAddress()) {
|
||||||
GlobalValue *GA = MI->getOperand(3).getGlobal();
|
GlobalValue *GA = MI->getOperand(3).getGlobal();
|
||||||
|
int Offset = MI->getOperand(3).getOffset();
|
||||||
I = MBB.insert(MBB.erase(I),
|
I = MBB.insert(MBB.erase(I),
|
||||||
BuildMI(Opcode, 5).addReg(R0).addZImm(Scale).
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user