mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-06 05:33:28 +00:00
Fix a bug in the local spiller, where we could take code like this:
store r12 -> [ss#2] R3 = load [ss#1] use R3 R3 = load [ss#2] R4 = load [ss#1] and turn it into this code: store R12 -> [ss#2] R3 = load [ss#1] use R3 R3 = R12 R4 = R3 <- oops! The problem was that promoting R3 = load[ss#2] to a copy missed the fact that the instruction invalidated R3 at that point. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23638 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f5c6e6b745
commit
22480c4350
@ -490,11 +490,11 @@ void LocalSpiller::RewriteMBB(MachineBasicBlock &MBB, const VirtRegMap &VRM) {
|
|||||||
if (DestReg != It->second) {
|
if (DestReg != It->second) {
|
||||||
MRI->copyRegToReg(MBB, &MI, DestReg, It->second,
|
MRI->copyRegToReg(MBB, &MI, DestReg, It->second,
|
||||||
MF.getSSARegMap()->getRegClass(VirtReg));
|
MF.getSSARegMap()->getRegClass(VirtReg));
|
||||||
// Revisit the copy if the destination is a vreg.
|
// Revisit the copy so we make sure to notice the effects of the
|
||||||
if (MRegisterInfo::isVirtualRegister(DestReg)) {
|
// operation on the destreg (either needing to RA it if it's
|
||||||
NextMII = &MI;
|
// virtual or needing to clobber any values if it's physical).
|
||||||
--NextMII; // backtrack to the copy.
|
NextMII = &MI;
|
||||||
}
|
--NextMII; // backtrack to the copy.
|
||||||
}
|
}
|
||||||
MBB.erase(&MI);
|
MBB.erase(&MI);
|
||||||
goto ProcessNextInst;
|
goto ProcessNextInst;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user