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

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 14 11:13:47 PDT 2018


spatel added a reviewer: lebedev.ri.
spatel 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
----------------
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.


https://reviews.llvm.org/D50714





More information about the llvm-commits mailing list