mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-16 12:24:03 +00:00
TwoAddressInstructionPass doesn't really know how to merge live intervals when
lowering REG_SEQUENCE instructions. Insert copies for REG_SEQUENCE sources not killed to avoid breaking later passes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104146 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1275,9 +1275,10 @@ bool TwoAddressInstructionPass::EliminateRegSequences() {
|
||||
|
||||
if (!Seen.insert(SrcReg) ||
|
||||
MI->getParent() != DefMI->getParent() ||
|
||||
!MI->getOperand(i).isKill() ||
|
||||
HasOtherRegSequenceUses(SrcReg, MI, MRI)) {
|
||||
// REG_SEQUENCE cannot have duplicated operands, add a copy.
|
||||
// Also add an copy if the source if live-in the block. We don't want
|
||||
// Also add an copy if the source is live-in the block. We don't want
|
||||
// to end up with a partial-redef of a livein, e.g.
|
||||
// BB0:
|
||||
// reg1051:10<def> =
|
||||
@ -1287,6 +1288,10 @@ bool TwoAddressInstructionPass::EliminateRegSequences() {
|
||||
// BB2:
|
||||
// reg1051:9<def> =
|
||||
// LiveIntervalAnalysis won't like it.
|
||||
//
|
||||
// If the REG_SEQUENCE doesn't kill its source, keeping live variables
|
||||
// correctly up to date becomes very difficult. Insert a copy.
|
||||
//
|
||||
const TargetRegisterClass *RC = MRI->getRegClass(SrcReg);
|
||||
unsigned NewReg = MRI->createVirtualRegister(RC);
|
||||
MachineBasicBlock::iterator InsertLoc = MI;
|
||||
|
Reference in New Issue
Block a user