[PATCH] D27028: Add intrinsics for constrained floating point operations

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 5 14:49:05 PST 2016


mehdi_amini added inline comments.


================
Comment at: lib/IR/IntrinsicInst.cpp:107
+  else if (RoundingArg.equals("LLVM_ROUND_TONEAREST"))
+    return rmToNearest;
+  else if (RoundingArg.equals("LLVM_ROUND_DOWNWARD")) 
----------------
andrew.w.kaylor wrote:
> craig.topper wrote:
> > andrew.w.kaylor wrote:
> > > craig.topper wrote:
> > > > You could maybe use a StringSwitch.
> > > That would be perfect, but can I put an llvm_unreachable() in a StringSwitch?
> > I think StringSwitch will assert if it doesn't find a match and there is no default specified.
> Yes, I saw that in the code.  I wanted something that was informative in non-assert mode too.  I guess the obvious solution to that is to add something like an UnreachableDefault() method to StringSwitch.
"Informative" as in "triggers a runtime failure"? Unreachable isn't the right solution, it is UB in release mode AFAIK.



Repository:
  rL LLVM

https://reviews.llvm.org/D27028





More information about the llvm-commits mailing list