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

Andy Kaylor via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 5 14:41:56 PST 2016


andrew.w.kaylor 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")) 
----------------
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.


Repository:
  rL LLVM

https://reviews.llvm.org/D27028





More information about the llvm-commits mailing list