[clang] [llvm] [IR] Don't set strictfp on irrelevant calls (PR #122735)

Kevin P. Neal via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 4 07:02:25 PST 2025


================
@@ -66,6 +66,12 @@ bool IntrinsicInst::mayLowerToFunctionCall(Intrinsic::ID IID) {
   }
 }
 
+bool IntrinsicInst::canAccessFPEnvironment(LLVMContext &C, Intrinsic::ID IID) {
+  AttributeList Attrs = Intrinsic::getAttributes(C, IID);
+  MemoryEffects ME = Attrs.getMemoryEffects();
+  return ME.onlyAccessesInaccessibleMem();
----------------
kpneal wrote:

Wouldn't a large fraction of existing functions that may or may not have any floating point in them qualify as doesAccessInaccessibleMem()? It seems like if we're going to model the FP environment like "memory" then we need an FP environment modeling flag proper.

https://github.com/llvm/llvm-project/pull/122735


More information about the llvm-commits mailing list