[PATCH] D53157: Teach the IRBuilder about constrained fadd and friends

John McCall via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 1 11:26:39 PDT 2019


rjmccall added inline comments.


================
Comment at: include/llvm/IR/IRBuilder.h:259
+    return DefaultConstrainedRounding.getValue();
+  }
+
----------------
Okay, so what are the invariants here now?  It looks like, in order to enable constrained floating point, I need to also have set the default exception behavior and rounding mode.  That should at least be documented, but maybe a better approach would be to require these to be passed in when enabling constrained FP.


================
Comment at: include/llvm/IR/IRBuilder.h:1324
+      return CreateConstrainedFPBinOp(Intrinsic::experimental_constrained_fadd,
+                                      L, R, nullptr, Name);
+
----------------
`FPMD` is dropped in this case; I don't know if that's intentional.


================
Comment at: include/llvm/IR/IRBuilder.h:1459
+      Optional<ConstrainedFPIntrinsic::RoundingMode> Rounding = None,
+      Optional<ConstrainedFPIntrinsic::ExceptionBehavior> Except = None) {
+    Value *RoundingV = getConstrainedFPRounding(Rounding);
----------------
It looks like nothing in `IRBuilder` ever passes these arguments.  Are you just anticipating that someone might want to call this directly?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D53157/new/

https://reviews.llvm.org/D53157





More information about the llvm-commits mailing list