[PATCH] D50714: [InstCombine] Fold Select with binary op - FP opcodes

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 18 08:55:38 PDT 2018


xbolva00 added inline comments.


================
Comment at: lib/Transforms/InstCombine/InstCombineSelect.cpp:71
+  else if (FCmpInst::isEquality(Pred))
+    IsEq = Pred == FCmpInst::FCMP_OEQ || Pred == FCmpInst::FCMP_UEQ;
+  else
----------------
spatel wrote:
> xbolva00 wrote:
> > spatel wrote:
> > > Did you step through the scenarios where X is NAN? I don't think the transform is valid for both predicates (similarly for ONE/UNE).
> > Ok, so probably not worth to with FP opcodes? if it is so complicated.. Alive has some problems with float?
> AFAIK, Alive doesn't support FP yet.
> I think this is still a good optimization for FP, we just have to do it carefully. So that just means prove that the output is correct with a NAN input and one or more of the FP predicates.
How can we prove it?

I will add many tests with nan tomorrow so we can see changes directly.


https://reviews.llvm.org/D50714





More information about the llvm-commits mailing list