Skip to content

Commit 1324a5f

Browse files
Fix for #101613
Changes X86InstrInfo.cpp updated with check to ignore inlineasm pr59305.ll Test case fix
1 parent 12937b1 commit 1324a5f

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
@@ -3537,10 +3537,10 @@ static bool isX87Reg(unsigned Reg) {
35373537

35383538
/// check if the instruction is X87 instruction
35393539
bool X86::isX87Instruction(MachineInstr &MI) {
3540-
// Call defs X87 register, so we special case it here because
3540+
// Call and inlineasm defs X87 register, so we special case it here because
35413541
// otherwise calls are incorrectly flagged as x87 instructions
35423542
// as a result.
3543-
if (MI.isCall())
3543+
if (MI.isCall() || MI.isInlineAsm())
35443544
return false;
35453545
for (const MachineOperand &MO : MI.operands()) {
35463546
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)