mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-11 08:29:25 +00:00
Fix pr4552. Stack slot coloring with register must take care not to generate illegal ams.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76258 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -503,6 +503,15 @@ bool StackSlotColoring::PropagateBackward(MachineBasicBlock::iterator MII,
|
||||
if (Reg == OldReg) {
|
||||
if (MO.isImplicit())
|
||||
return false;
|
||||
|
||||
// Abort the use is actually a sub-register def. We don't have enough
|
||||
// information to figure out if it is really legal.
|
||||
if (MO.getSubReg() ||
|
||||
TID.getOpcode() == TargetInstrInfo::EXTRACT_SUBREG ||
|
||||
TID.getOpcode() == TargetInstrInfo::INSERT_SUBREG ||
|
||||
TID.getOpcode() == TargetInstrInfo::SUBREG_TO_REG)
|
||||
return false;
|
||||
|
||||
const TargetRegisterClass *RC = getInstrOperandRegClass(TRI, TID, i);
|
||||
if (RC && !RC->contains(NewReg))
|
||||
return false;
|
||||
@@ -561,12 +570,19 @@ bool StackSlotColoring::PropagateForward(MachineBasicBlock::iterator MII,
|
||||
if (MO.isDef() || MO.isImplicit())
|
||||
return false;
|
||||
|
||||
// Abort the use is actually a sub-register use. We don't have enough
|
||||
// information to figure out if it is really legal.
|
||||
if (MO.getSubReg() ||
|
||||
TID.getOpcode() == TargetInstrInfo::EXTRACT_SUBREG)
|
||||
return false;
|
||||
|
||||
const TargetRegisterClass *RC = getInstrOperandRegClass(TRI, TID, i);
|
||||
if (RC && !RC->contains(NewReg))
|
||||
return false;
|
||||
FoundUse = true;
|
||||
if (MO.isKill())
|
||||
FoundKill = true;
|
||||
|
||||
Uses.push_back(&MO);
|
||||
} else if (TRI->regsOverlap(Reg, NewReg) ||
|
||||
TRI->regsOverlap(Reg, OldReg))
|
||||
|
Reference in New Issue
Block a user