]> granicus.if.org Git - llvm/commit
[InstCombine] fold shuffles of insert_subvectors
authorSanjay Patel <spatel@rotateright.com>
Wed, 22 May 2019 00:32:25 +0000 (00:32 +0000)
committerSanjay Patel <spatel@rotateright.com>
Wed, 22 May 2019 00:32:25 +0000 (00:32 +0000)
commite607aa81a58cdc64d9d80c897d3cecee10048ad4
treee68ea05c236ec9cdd57b7fe14c70da69413fa07c
parent662b7589c0ea74fe9c69875ae636fc68dda3faf9
[InstCombine] fold shuffles of insert_subvectors

This should be a valid exception to the general rule of not creating new shuffle masks in IR...
because we already do it. :)
Also, DAG combining/legalization will undo this by widening the shuffle back out if needed.

Explanation for how we already do this: SLP or vector source can create chains of insert/extract
as shown in 1 of the examples from PR16739:
https://godbolt.org/z/NlK7rA
https://bugs.llvm.org/show_bug.cgi?id=16739

And we expect instcombine or DAGCombine to clean that up by creating relatively simple shuffles.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361338 91177308-0d34-0410-b5e6-96231b3b80d8
docs/CodeGenerator.rst
lib/Transforms/InstCombine/InstCombineVectorOps.cpp
test/Transforms/InstCombine/vec_shuffle.ll