Skip to content

Simple check to ignore Inline asm fwait insertion #101686

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions llvm/lib/Target/X86/X86InstrInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3537,10 +3537,10 @@ static bool isX87Reg(unsigned Reg) {

/// check if the instruction is X87 instruction
bool X86::isX87Instruction(MachineInstr &MI) {
// Call defs X87 register, so we special case it here because
// 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.isCall())
if (MI.isCall() || MI.isInlineAsm())
return false;
for (const MachineOperand &MO : MI.operands()) {
if (!MO.isReg())
Expand Down
4 changes: 1 addition & 3 deletions llvm/test/CodeGen/X86/pr59305.ll
Original file line number Diff line number Diff line change
Expand Up @@ -81,20 +81,17 @@ define double @bar(double %0) #0 {
; X64-NEXT: #APP
; X64-NEXT: ldmxcsr 0
; X64-NEXT: #NO_APP
; X64-NEXT: wait
; X64-NEXT: movsd {{.*#+}} xmm2 = [1.0E+0,0.0E+0]
; X64-NEXT: movapd %xmm2, %xmm3
; X64-NEXT: divsd %xmm0, %xmm3
; X64-NEXT: #APP
; X64-NEXT: ldmxcsr 0
; X64-NEXT: #NO_APP
; X64-NEXT: wait
; X64-NEXT: movapd %xmm2, %xmm1
; X64-NEXT: divsd %xmm0, %xmm1
; X64-NEXT: #APP
; X64-NEXT: ldmxcsr 0
; X64-NEXT: #NO_APP
; X64-NEXT: wait
; X64-NEXT: divsd %xmm0, %xmm2
; X64-NEXT: movapd %xmm3, %xmm0
; X64-NEXT: callq fma@PLT
Expand All @@ -105,6 +102,7 @@ define double @bar(double %0) #0 {
; X86: # %bb.0:
; X86-NEXT: subl $28, %esp
; X86-NEXT: fldl {{[0-9]+}}(%esp)
; X86-NEXT: wait
; X86-NEXT: #APP
; X86-NEXT: fldcw 0
; X86-NEXT: #NO_APP
Expand Down
Loading