mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-15 05:24:01 +00:00
TwoAddressInstructionPass::CoalesceExtSubRegs can insert INSERT_SUBREG
instructions, but it doesn't really understand live ranges, so the first INSERT_SUBREG uses an implicitly defined register. Fix it in LiveVariableAnalysis by adding the <undef> flag. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106333 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -329,9 +329,16 @@ void LiveIntervals::handleVirtualRegisterDef(MachineBasicBlock *mbb,
|
||||
MachineInstr *CopyMI = NULL;
|
||||
unsigned SrcReg, DstReg, SrcSubReg, DstSubReg;
|
||||
if (mi->isExtractSubreg() || mi->isInsertSubreg() || mi->isSubregToReg() ||
|
||||
tii_->isMoveInstr(*mi, SrcReg, DstReg, SrcSubReg, DstSubReg))
|
||||
tii_->isMoveInstr(*mi, SrcReg, DstReg, SrcSubReg, DstSubReg)) {
|
||||
CopyMI = mi;
|
||||
|
||||
// Some of the REG_SEQUENCE lowering in TwoAddressInstrPass creates
|
||||
// implicit defs without really knowing. It shows up as INSERT_SUBREG
|
||||
// using an undefined register.
|
||||
if (mi->isInsertSubreg())
|
||||
mi->getOperand(1).setIsUndef();
|
||||
}
|
||||
|
||||
VNInfo *ValNo = interval.getNextValue(defIndex, CopyMI, true,
|
||||
VNInfoAllocator);
|
||||
assert(ValNo->id == 0 && "First value in interval is not 0?");
|
||||
|
Reference in New Issue
Block a user