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

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 13 10:14:53 PST 2025


================
@@ -66,6 +66,17 @@ bool IntrinsicInst::mayLowerToFunctionCall(Intrinsic::ID IID) {
   }
 }
 
+bool IntrinsicInst::canAccessFPEnvironment(Intrinsic::ID IID) {
+  switch (IID) {
+#define DAG_INSTRUCTION(NAME, NARG, ROUND_MODE, INTRINSIC, DAGN)               \
+case Intrinsic::INTRINSIC:
+#include "llvm/IR/ConstrainedOps.def"
----------------
efriedma-quic wrote:

This doesn't seem right.  We have intrinsics to explicitly access the FP environment (llvm.set.rounding etc.).  And any intrinsic which can call user code can access the FP environment.

You might need to specify this in the .td files (IntrStrictFP or something like that).

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


More information about the llvm-commits mailing list