diff --git a/lib/Target/X86/X86InstrInfo.cpp b/lib/Target/X86/X86InstrInfo.cpp index cd783f3cf8b..aa15723c46e 100644 --- a/lib/Target/X86/X86InstrInfo.cpp +++ b/lib/Target/X86/X86InstrInfo.cpp @@ -158,7 +158,9 @@ X86InstrInfo::convertToThreeAddress(MachineFunction::iterator &MFI, unsigned ShAmt = MI->getOperand(2).getImm(); if (ShAmt == 0 || ShAmt >= 4) return 0; - NewMI = BuildMI(get(X86::LEA32r), Dest) + unsigned Opc = TM.getSubtarget().is64Bit() ? + X86::LEA64_32r : X86::LEA32r; + NewMI = BuildMI(get(Opc), Dest) .addReg(0).addImm(1 << ShAmt).addReg(Src).addImm(0); break; }