mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-28 04:33:05 +00:00
Preserve <def,undef> flags in CoalesceExtSubRegs.
This won't have an effect until EliminateRegSequences() starts setting the undef flags. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148779 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
45bb5c5333
commit
defe12df51
@ -1728,8 +1728,10 @@ TwoAddressInstructionPass::CoalesceExtSubRegs(SmallVector<unsigned,4> &Srcs,
|
||||
CanCoalesce = false;
|
||||
break;
|
||||
}
|
||||
// Keep track of one of the uses.
|
||||
SomeMI = UseMI;
|
||||
// Keep track of one of the uses. Preferably the first one which has a
|
||||
// <def,undef> flag.
|
||||
if (!SomeMI || UseMI->getOperand(0).isUndef())
|
||||
SomeMI = UseMI;
|
||||
}
|
||||
if (!CanCoalesce)
|
||||
continue;
|
||||
@ -1738,7 +1740,9 @@ TwoAddressInstructionPass::CoalesceExtSubRegs(SmallVector<unsigned,4> &Srcs,
|
||||
MachineInstr *CopyMI = BuildMI(*SomeMI->getParent(), SomeMI,
|
||||
SomeMI->getDebugLoc(),
|
||||
TII->get(TargetOpcode::COPY))
|
||||
.addReg(DstReg, RegState::Define, NewDstSubIdx)
|
||||
.addReg(DstReg, RegState::Define |
|
||||
getUndefRegState(SomeMI->getOperand(0).isUndef()),
|
||||
NewDstSubIdx)
|
||||
.addReg(SrcReg, 0, NewSrcSubIdx);
|
||||
|
||||
// Remove all the old extract instructions.
|
||||
|
Loading…
Reference in New Issue
Block a user