[llvm] Fixes #101613 simple check to ignore Inline asm fwait insertion (PR #101686)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 2 08:20:21 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-backend-x86
Author: Temperatureblock (Temperature-block)
<details>
<summary>Changes</summary>
Just a simple check to ignore Inline asm fwait insertion
---
Full diff: https://github.com/llvm/llvm-project/pull/101686.diff
2 Files Affected:
- (modified) llvm/lib/Target/X86/X86InsertWait.cpp (+3-2)
- (modified) llvm/test/CodeGen/X86/pr59305.ll (-3)
``````````diff
diff --git a/llvm/lib/Target/X86/X86InsertWait.cpp b/llvm/lib/Target/X86/X86InsertWait.cpp
index 69a3d32a93149..0a1810a3da711 100644
--- a/llvm/lib/Target/X86/X86InsertWait.cpp
+++ b/llvm/lib/Target/X86/X86InsertWait.cpp
@@ -103,8 +103,9 @@ bool WaitInsert::runOnMachineFunction(MachineFunction &MF) {
for (MachineBasicBlock &MBB : MF) {
for (MachineBasicBlock::iterator MI = MBB.begin(); MI != MBB.end(); ++MI) {
- // Jump non X87 instruction.
- if (!X86::isX87Instruction(*MI))
+
+ // Jump non X87 instruction and Inline asm.
+ if (!X86::isX87Instruction(*MI) || MI->isInlineAsm())
continue;
// If the instruction instruction neither has float exception nor is
// a load/store instruction, or the instruction is x87 control
diff --git a/llvm/test/CodeGen/X86/pr59305.ll b/llvm/test/CodeGen/X86/pr59305.ll
index 46c9da5a51939..5185f1429f289 100644
--- a/llvm/test/CodeGen/X86/pr59305.ll
+++ b/llvm/test/CodeGen/X86/pr59305.ll
@@ -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 at PLT
``````````
</details>
https://github.com/llvm/llvm-project/pull/101686
More information about the llvm-commits
mailing list