[PATCH] D31980: [InstCombine] fix wrong undef handling when converting select to shuffle

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 12 11:03:41 PDT 2017


spatel added inline comments.


================
Comment at: lib/Transforms/InstCombine/InstCombineSelect.cpp:1059
+      // give up.
+      return nullptr;
     } else {
----------------
efriedma wrote:
> You could treat the undef as if it were true or false here (just pick arbitrarily), but I'm not sure what the right heuristic would be.  You can just leave it for now, I guess.
Right - I thought about that as a follow-up. We can handle the case where all defined elements are coming from one side or the other by choosing the undef elements from the same side. That could be done in instsimplify, so all we're left with here is the case where we are choosing from both sides and have undef elements.


https://reviews.llvm.org/D31980





More information about the llvm-commits mailing list