[PATCH] D44626: [InstCombine] Fold (A OR B) AND B code sequence over Phi node

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 26 16:32:59 PDT 2018


efriedma added a reviewer: spatel.
efriedma added a comment.

I'm still not sure this is really as general as it could be, but I guess it's okay.



================
Comment at: lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:1423
+  if (llvm::none_of(Phi->incoming_values(), IsEligible))
+    return nullptr;
+
----------------
This logic doesn't work if AndVal isn't a constant (e.g. consider the case where the "and" and "or" are in the same basic block).


https://reviews.llvm.org/D44626





More information about the llvm-commits mailing list