[llvm] [ARM] Remove `NoInfsFPMath` and `NoNaNsFPMath` uses (PR #179935)

via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 5 04:50:21 PST 2026


https://github.com/paperchalice created https://github.com/llvm/llvm-project/pull/179935

Remove these global flags uses, they are used in `TargetMachine::resetTargetOptions`, which makes `TargetMachine` thread unsafe.

>From c9313b32f7307fd9919aabe9406f32d96f7bae33 Mon Sep 17 00:00:00 2001
From: PaperChalice <liujunchang97 at outlook.com>
Date: Thu, 5 Feb 2026 20:48:23 +0800
Subject: [PATCH] [ARM] Remove `NoInfsFPMath` and `NoNaNsFPMath` uses

---
 llvm/lib/Target/ARM/ARMAsmPrinter.cpp | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp
index c77023aed437f..abc5c6dac900c 100644
--- a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp
+++ b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp
@@ -795,16 +795,12 @@ void ARMAsmPrinter::emitAttributes() {
       ATS.emitAttribute(ARMBuildAttrs::ABI_FP_rounding, ARMBuildAttrs::Allowed);
   }
 
-  // TM.Options.NoInfsFPMath && TM.Options.NoNaNsFPMath is the
-  // equivalent of GCC's -ffinite-math-only flag.
+  // Generate ABI tags from module flags.
   if (auto *NumModel = mdconst::extract_or_null<ConstantInt>(
           MMI->getModule()->getModuleFlag("arm-eabi-fp-number-model"))) {
     if (unsigned TagVal = NumModel->getZExtValue())
       ATS.emitAttribute(ARMBuildAttrs::ABI_FP_number_model, TagVal);
-  } else if (TM.Options.NoInfsFPMath && TM.Options.NoNaNsFPMath)
-    ATS.emitAttribute(ARMBuildAttrs::ABI_FP_number_model,
-                      ARMBuildAttrs::Allowed);
-  else
+  } else
     ATS.emitAttribute(ARMBuildAttrs::ABI_FP_number_model,
                       ARMBuildAttrs::AllowIEEE754);
 



More information about the llvm-commits mailing list