Skip to content

Commit 3170345

Browse files
authored
[X86] Fix LEA compression on 64 bit (#166334)
NDD ADD is only supported on 64 bit, but `LEA32` has `Requires<[Not64BitMode]>`. The reason it doesnt fail upstream is that the predicates check is commented out on `X86MCInstLower.cpp`: ``` // FIXME: Enable feature predicate checks once all the test pass. // X86_MC::verifyInstructionPredicates(MI->getOpcode(), // Subtarget->getFeatureBits()); ``` Introduced by: #158254
1 parent b258681 commit 3170345

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Target/X86/X86CompressEVEX.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ static bool CompressEVEXImpl(MachineInstr &MI, MachineBasicBlock &MBB,
272272
const MachineOperand &Src2 = MI.getOperand(2);
273273
bool Is32BitReg = Opc == X86::ADD32ri_ND || Opc == X86::ADD32rr_ND;
274274
const MCInstrDesc &NewDesc =
275-
ST.getInstrInfo()->get(Is32BitReg ? X86::LEA32r : X86::LEA64r);
275+
ST.getInstrInfo()->get(Is32BitReg ? X86::LEA64_32r : X86::LEA64r);
276276
if (Is32BitReg)
277277
Src1 = getX86SubSuperRegister(Src1, 64);
278278
MachineInstrBuilder MIB = BuildMI(MBB, MI, MI.getDebugLoc(), NewDesc, Dst)

0 commit comments

Comments
 (0)