[PATCH] D81900: Add coverage for inexact constant folding for multiplication in Selection DAG

Michael Berg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 15 19:51:05 PDT 2020


mcberg2017 marked an inline comment as done.
mcberg2017 added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:5139-5140
+          RHS.multiply(LHS, APFloat::rmNearestTiesToEven);
+      if (((status & APFloat::opInexact) == 0) ||
+          getTarget().Options.UnsafeFPMath) {
+        return getConstantFP(RHS, DL, VT);
----------------
arsenm wrote:
> I'm not sure I understand why this would depend on unsafe math. Why does it matter if it was inexact? The unconstrained operations have the defined rounding mode
With Unsafe any contracts concerning the ability to deliver infinite precision are broken, ergo Unsafe overrides and allows the result regardless as precision is relaxed and its behavior as well.


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

https://reviews.llvm.org/D81900





More information about the llvm-commits mailing list