File tree 1 file changed +2
-1
lines changed 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -1832,6 +1832,7 @@ bool TwoAddressInstructionPass::EliminateRegSequences() {
1832
1832
SmallSet<unsigned , 4 > Seen;
1833
1833
for (unsigned i = 1 , e = MI->getNumOperands (); i < e; i += 2 ) {
1834
1834
unsigned SrcReg = MI->getOperand (i).getReg ();
1835
+ unsigned SrcSubIdx = MI->getOperand (i).getSubReg ();
1835
1836
unsigned SubIdx = MI->getOperand (i+1 ).getImm ();
1836
1837
// DefMI of NULL means the value does not have a vreg in this block
1837
1838
// i.e., its a physical register or a subreg.
@@ -1887,7 +1888,7 @@ bool TwoAddressInstructionPass::EliminateRegSequences() {
1887
1888
MachineInstr *CopyMI = BuildMI (*MI->getParent (), InsertLoc,
1888
1889
MI->getDebugLoc (), TII->get (TargetOpcode::COPY))
1889
1890
.addReg (DstReg, RegState::Define, SubIdx)
1890
- .addReg (SrcReg, getKillRegState (isKill));
1891
+ .addReg (SrcReg, getKillRegState (isKill), SrcSubIdx );
1891
1892
MI->getOperand (i).setReg (0 );
1892
1893
if (LV && isKill && !TargetRegisterInfo::isPhysicalRegister (SrcReg))
1893
1894
LV->replaceKillInstruction (SrcReg, MI, CopyMI);
You can’t perform that action at this time.
0 commit comments