[llvm] [CodeGen] Remove most NoNaNsFPMath uses (PR #163484)

via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 14 22:08:03 PDT 2025


https://github.com/paperchalice updated https://github.com/llvm/llvm-project/pull/163484

>From 4492973bbca82c5d4aaafc6c2fc9d93f1e723f79 Mon Sep 17 00:00:00 2001
From: PaperChalice <liujunchang97 at outlook.com>
Date: Wed, 15 Oct 2025 13:07:49 +0800
Subject: [PATCH] [GlobalISel] Remove NoNaNsFPMath uses

---
 llvm/lib/CodeGen/GlobalISel/Utils.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/llvm/lib/CodeGen/GlobalISel/Utils.cpp b/llvm/lib/CodeGen/GlobalISel/Utils.cpp
index 055fdc6ad7213..ca82857319abc 100644
--- a/llvm/lib/CodeGen/GlobalISel/Utils.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/Utils.cpp
@@ -818,8 +818,7 @@ bool llvm::isKnownNeverNaN(Register Val, const MachineRegisterInfo &MRI,
   if (!DefMI)
     return false;
 
-  const TargetMachine& TM = DefMI->getMF()->getTarget();
-  if (DefMI->getFlag(MachineInstr::FmNoNans) || TM.Options.NoNaNsFPMath)
+  if (DefMI->getFlag(MachineInstr::FmNoNans))
     return true;
 
   // If the value is a constant, we can obviously see if it is a NaN or not.



More information about the llvm-commits mailing list