[llvm] [X86] Treat returns as SpecialFP values (PR #83615)

via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 3 10:26:34 PST 2024


https://github.com/AtariDreams updated https://github.com/llvm/llvm-project/pull/83615

>From 0b0463b17fd60e30af713d2ab7b5d26e1ae4bf4c Mon Sep 17 00:00:00 2001
From: Rose <83477269+AtariDreams at users.noreply.github.com>
Date: Fri, 1 Mar 2024 14:31:26 -0500
Subject: [PATCH] [X86] Treat returns as SpecialFP values

SpecialFP value handling function has logic for handling returns, but for returns it never gets called because the codepath for it was mistakenly omitted.
---
 llvm/lib/Target/X86/X86FloatingPoint.cpp | 3 +++
 1 file changed, 3 insertions(+)

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!
 



More information about the llvm-commits mailing list