[PATCH] D22114: [InstCombine] extend vector select matching for non-splat constants

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 7 15:49:36 PDT 2016

spatel added a comment.

In http://reviews.llvm.org/D22114#477445, @eli.friedman wrote:

> Do we care at all about the number of uses of the operands?

Good question. I was assuming one-use based on my motivating examples, but since we're potentially creating an xor here and bitcasts above this, we probably do need to check that.

Comment at: lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:1601
@@ +1600,3 @@
+    // One element must be all ones, and the other must be all zeros.
+    if (!((match(EltC1, m_Zero()) && match(EltC2, m_AllOnes())) ||
eli.friedman wrote:
> What if one is undef?
Ah, right. Or even both elts could be undef?
Ok to make that a FIXME comment for this patch? I'll follow-up with the extra logic and test cases.


More information about the llvm-commits mailing list