[llvm-branch-commits] [llvm] [SelectionDAG] Adaptation for FP operation lowering (PR #138553)

Matt Arsenault via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon May 5 12:43:39 PDT 2025


================
@@ -8350,6 +8351,59 @@ void SelectionDAGBuilder::visitConstrainedFPIntrinsic(
   setValue(&FPI, FPResult);
 }
 
+void SelectionDAGBuilder::visitFPOperationIntrinsic(const CallInst &CI,
+                                                    unsigned Intrinsic) {
+  SDLoc sdl = getCurSDLoc();
+  bool StrictFP =
+      FuncInfo.Fn->getAttributes().hasFnAttr(llvm::Attribute::StrictFP);
+
+  int Opcode = -1;
+  switch (Intrinsic) {
+#define CONSTRAINED(NAME, DAGN)
+#define FUNCTION(NAME, DAGN)                                                   \
+  case Intrinsic::NAME:                                                        \
+    Opcode = StrictFP ? ISD::STRICT_##DAGN : ISD::DAGN;                        \
+    break;
+#include "llvm/IR/FloatingPointOps.def"
+  }
+
+  SDNodeFlags Flags;
+  if (CI.getExceptionBehavior() == fp::ExceptionBehavior::ebIgnore)
+    Flags.setNoFPExcept(true);
----------------
arsenm wrote:

Can you reorder this with the use of CI.getExceptionBehavior below, so all of the exception mode dependent code is together 

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


More information about the llvm-branch-commits mailing list