Missed part of recommit.
authorChristopher Lamb <christopher.lamb@gmail.com>
Tue, 11 Mar 2008 10:27:36 +0000 (10:27 +0000)
committerChristopher Lamb <christopher.lamb@gmail.com>
Tue, 11 Mar 2008 10:27:36 +0000 (10:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48224 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86InstrInfo.cpp

index 762a7bc66535b1f83d170967a972bfb8126bcd98..20dd263d1ff4fdd470a4693349b32d6fcff554ee 100644 (file)
@@ -904,15 +904,18 @@ X86InstrInfo::convertToThreeAddress(MachineFunction::iterator &MFI,
       unsigned leaInReg = RegInfo.createVirtualRegister(&X86::GR32RegClass);
       unsigned leaOutReg = RegInfo.createVirtualRegister(&X86::GR32RegClass);
             
-      MachineInstr *Ins =
-        BuildMI(get(X86::INSERT_SUBREG), leaInReg).addReg(Src).addImm(2);
-      Ins->copyKillDeadInfo(MI);
+      // Build and insert into an implicit UNDEF value. This is OK because
+      // well be shifting and then extracting the lower 16-bits. 
+      MachineInstr *Ins = 
+       BuildMI(get(X86::INSERT_SUBREG),leaInReg).addImm(X86::IMPL_VAL_UNDEF)
+         .addReg(Src).addImm(X86::SUBREG_16BIT);
       
       NewMI = BuildMI(get(Opc), leaOutReg)
         .addReg(0).addImm(1 << ShAmt).addReg(leaInReg).addImm(0);
       
       MachineInstr *Ext =
-        BuildMI(get(X86::EXTRACT_SUBREG), Dest).addReg(leaOutReg).addImm(2);
+        BuildMI(get(X86::EXTRACT_SUBREG), Dest)
+         .addReg(leaOutReg).addImm(X86::SUBREG_16BIT);
       Ext->copyKillDeadInfo(MI);
       
       MFI->insert(MBBI, Ins);            // Insert the insert_subreg