diff --git a/llvm/lib/Target/X86/X86InstrInfo.cpp b/llvm/lib/Target/X86/X86InstrInfo.cpp index 10a0ccdcb023290e52f8f0a4c33b032580995965..e615fa09608c56194440176a9b1297576bac4950 100644 --- a/llvm/lib/Target/X86/X86InstrInfo.cpp +++ b/llvm/lib/Target/X86/X86InstrInfo.cpp @@ -2947,6 +2947,11 @@ static bool isX87Reg(unsigned Reg) { /// check if the instruction is X87 instruction bool X86::isX87Instruction(MachineInstr &MI) { + // Call and inlineasm defs X87 register, so we special case it here because + // otherwise calls are incorrectly flagged as x87 instructions + // as a result. + if (MI.isInlineAsm()) + return false; for (const MachineOperand &MO : MI.operands()) { if (!MO.isReg()) continue;