[llvm] [X86] Treat returns as SpecialFP values (PR #83615)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 1 12:11:34 PST 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-backend-x86
Author: AtariDreams (AtariDreams)
<details>
<summary>Changes</summary>
SpecialFP value handling function has logic for handling returns, but for returns it never gets called because the codepath for it was mistakenly omitted.
---
Full diff: https://github.com/llvm/llvm-project/pull/83615.diff
1 Files Affected:
- (modified) llvm/lib/Target/X86/X86FloatingPoint.cpp (+3)
``````````diff
diff --git a/llvm/lib/Target/X86/X86FloatingPoint.cpp b/llvm/lib/Target/X86/X86FloatingPoint.cpp
index ca4d03913d093e..5064e75fb44348 100644
--- a/llvm/lib/Target/X86/X86FloatingPoint.cpp
+++ b/llvm/lib/Target/X86/X86FloatingPoint.cpp
@@ -432,6 +432,9 @@ bool FPS::processBasicBlock(MachineFunction &MF, MachineBasicBlock &BB) {
if (MI.isCall())
FPInstClass = X86II::SpecialFP;
+ if (MI.isReturn())
+ FPInstClass = X86II::SpecialFP;
+
if (FPInstClass == X86II::NotFP)
continue; // Efficiently ignore non-fp insts!
``````````
</details>
https://github.com/llvm/llvm-project/pull/83615
More information about the llvm-commits
mailing list