OSDN Git Service

[InstCombine] canonicalize vector select with constant vector condition to shuffle
authorSanjay Patel <spatel@rotateright.com>
Fri, 16 Sep 2016 22:16:18 +0000 (22:16 +0000)
committerSanjay Patel <spatel@rotateright.com>
Fri, 16 Sep 2016 22:16:18 +0000 (22:16 +0000)
commit16150b39473b1a27488cd8b7ec72e7067b6eaadf
treee43bcbdf9e8fbe6ad05494df9f08c3ff1cd2d97f
parent8f824feb124d4cd7827f1924d98a67718fc2db26
[InstCombine] canonicalize vector select with constant vector condition to shuffle

As discussed on llvm-dev ( http://lists.llvm.org/pipermail/llvm-dev/2016-August/104210.html ):
turn a vector select with constant condition operand into a shuffle as a canonicalization step.
Shuffles may be easier to reason about in conjunction with other shuffles and insert/extract.

Possible known (minor?) regressions from this change are filed as:
https://llvm.org/bugs/show_bug.cgi?id=28530
https://llvm.org/bugs/show_bug.cgi?id=28531
https://llvm.org/bugs/show_bug.cgi?id=30371

If something terrible happens to perf after this commit, feel free to revert until a backend
fix is in place.

Differential Revision: https://reviews.llvm.org/D24279

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281787 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineSelect.cpp
test/Transforms/InstCombine/blend_x86.ll
test/Transforms/InstCombine/logical-select.ll
test/Transforms/InstCombine/select.ll
test/Transforms/InstCombine/vec_demanded_elts.ll