Skip to content

Commit db3c3fc

Browse files
Simple check to ignore Inline asm fwait insertion (#101686)
Just a simple check to ignore Inline asm fwait insertion Fixes #101613
1 parent f2f4193 commit db3c3fc

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

llvm/lib/Target/X86/X86InstrInfo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3591,10 +3591,10 @@ static bool isX87Reg(unsigned Reg) {
35913591

35923592
/// check if the instruction is X87 instruction
35933593
bool X86::isX87Instruction(MachineInstr &MI) {
3594-
// Call defs X87 register, so we special case it here because
3594+
// Call and inlineasm defs X87 register, so we special case it here because
35953595
// otherwise calls are incorrectly flagged as x87 instructions
35963596
// as a result.
3597-
if (MI.isCall())
3597+
if (MI.isCall() || MI.isInlineAsm())
35983598
return false;
35993599
for (const MachineOperand &MO : MI.operands()) {
36003600
if (!MO.isReg())

llvm/test/CodeGen/X86/pr59305.ll

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,20 +81,17 @@ define double @bar(double %0) #0 {
8181
; X64-NEXT: #APP
8282
; X64-NEXT: ldmxcsr 0
8383
; X64-NEXT: #NO_APP
84-
; X64-NEXT: wait
8584
; X64-NEXT: movsd {{.*#+}} xmm2 = [1.0E+0,0.0E+0]
8685
; X64-NEXT: movapd %xmm2, %xmm3
8786
; X64-NEXT: divsd %xmm0, %xmm3
8887
; X64-NEXT: #APP
8988
; X64-NEXT: ldmxcsr 0
9089
; X64-NEXT: #NO_APP
91-
; X64-NEXT: wait
9290
; X64-NEXT: movapd %xmm2, %xmm1
9391
; X64-NEXT: divsd %xmm0, %xmm1
9492
; X64-NEXT: #APP
9593
; X64-NEXT: ldmxcsr 0
9694
; X64-NEXT: #NO_APP
97-
; X64-NEXT: wait
9895
; X64-NEXT: divsd %xmm0, %xmm2
9996
; X64-NEXT: movapd %xmm3, %xmm0
10097
; X64-NEXT: callq fma@PLT
@@ -105,6 +102,7 @@ define double @bar(double %0) #0 {
105102
; X86: # %bb.0:
106103
; X86-NEXT: subl $28, %esp
107104
; X86-NEXT: fldl {{[0-9]+}}(%esp)
105+
; X86-NEXT: wait
108106
; X86-NEXT: #APP
109107
; X86-NEXT: fldcw 0
110108
; X86-NEXT: #NO_APP

0 commit comments

Comments
 (0)