forked from OSchip/llvm-project
Preserve <def,undef> flags in CoalesceExtSubRegs.
This won't have an effect until EliminateRegSequences() starts setting the undef flags. llvm-svn: 148779
This commit is contained in:
parent
e4f3f102c2
commit
c46534a0cd
|
|
@ -1728,7 +1728,9 @@ TwoAddressInstructionPass::CoalesceExtSubRegs(SmallVector<unsigned,4> &Srcs,
|
|||
CanCoalesce = false;
|
||||
break;
|
||||
}
|
||||
// Keep track of one of the uses.
|
||||
// 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)
|
||||
|
|
@ -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