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

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 12 10:31:29 PDT 2017


efriedma added inline comments.


================
Comment at: docs/LangRef.rst:7077
+result is undef. The second operand may be undef if performing a shuffle
+from only one vector.
 
----------------
> The second operand may be undef if performing a shuffle from only one vector.

This is technically true, but not really a useful statement.  Probably better to explicitly state that an element of the result is undef iff the chosen element of the input is undef.


================
Comment at: lib/Transforms/InstCombine/InstCombineSelect.cpp:1059
+      // give up.
+      return nullptr;
     } else {
----------------
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.


https://reviews.llvm.org/D31980





More information about the llvm-commits mailing list