@@ -1318,7 +1318,8 @@ MachineInstr *X86InstrInfo::convertToThreeAddressWithLEA(unsigned MIOpc,
13181318 if (Src == Src2) {
13191319 // ADD8rr/ADD16rr killed %reg1028, %reg1028
13201320 // just a single insert_subreg.
1321- addRegReg (MIB, InRegLEA, true , InRegLEA, false );
1321+ addRegReg (MIB, InRegLEA, true , X86::NoSubRegister, InRegLEA, false ,
1322+ X86::NoSubRegister);
13221323 } else {
13231324 if (Subtarget.is64Bit ())
13241325 InRegLEA2 = RegInfo.createVirtualRegister (&X86::GR64_NOSPRegClass);
@@ -1331,7 +1332,8 @@ MachineInstr *X86InstrInfo::convertToThreeAddressWithLEA(unsigned MIOpc,
13311332 InsMI2 = BuildMI (MBB, &*MIB, MI.getDebugLoc (), get (TargetOpcode::COPY))
13321333 .addReg (InRegLEA2, RegState::Define, SubReg)
13331334 .addReg (Src2, getKillRegState (IsKill2), Src2SubReg);
1334- addRegReg (MIB, InRegLEA, true , InRegLEA2, true );
1335+ addRegReg (MIB, InRegLEA, true , X86::NoSubRegister, InRegLEA2, true ,
1336+ X86::NoSubRegister);
13351337 }
13361338 if (LV && IsKill2 && InsMI2)
13371339 LV->replaceKillInstruction (Src2, MI, *InsMI2);
@@ -1589,6 +1591,7 @@ MachineInstr *X86InstrInfo::convertToThreeAddress(MachineInstr &MI,
15891591 // the first call inserted a COPY from Src2 and marked it as killed.
15901592 isKill = isKill2;
15911593 SrcReg = SrcReg2;
1594+ SrcSubReg = SrcSubReg2;
15921595 } else {
15931596 if (!classifyLEAReg (MI, Src, Opc, /* AllowSP=*/ true , SrcReg, SrcSubReg,
15941597 isKill, ImplicitOp, LV, LIS))
@@ -1601,7 +1604,8 @@ MachineInstr *X86InstrInfo::convertToThreeAddress(MachineInstr &MI,
16011604 if (ImplicitOp2.getReg () != 0 )
16021605 MIB.add (ImplicitOp2);
16031606
1604- NewMI = addRegReg (MIB, SrcReg, isKill, SrcReg2, isKill2); // FIXME: Subregs
1607+ NewMI =
1608+ addRegReg (MIB, SrcReg, isKill, SrcSubReg, SrcReg2, isKill2, SrcSubReg2);
16051609
16061610 // Add kills if classifyLEAReg created a new register.
16071611 if (LV) {
0 commit comments