[AVX-512] Add support for changing the element size of PALIGNR/VALIGND/VALIGNQ shuffl...
authorCraig Topper <craig.topper@gmail.com>
Tue, 22 Nov 2016 03:51:53 +0000 (03:51 +0000)
committerCraig Topper <craig.topper@gmail.com>
Tue, 22 Nov 2016 03:51:53 +0000 (03:51 +0000)
commitda222670556b9eb67c1e75a313a3c59a594ad8c6
tree5d18b934eac1ad6cef678f4c049d83b2853fce7d
parent435890a4fe0db7ac309cf73cbe3648a3c1052b4c
[AVX-512] Add support for changing the element size of PALIGNR/VALIGND/VALIGNQ shuffles if they feed a vselect with a different type

Summary:
Shuffle lowering widens the element size of a shuffle if elements are contiguous. This is sometimes help because wider element types have more shuffle options. If the shuffle is one of the arguments to a vselect this shuffle widening can introduce a bitcast between the vselect and the shuffle. This will prevent isel from selecting a masked operation. If the shuffle can be written equally efficiently with a different element size to match the vselect type we should change the shuffle type to allow masking.

This patch does this conversion for all VALIGND/VALIGNQ sizes. It also supports turning 128-bit PALIGNR into VALIGND/VALIGNQ. This fixes the case shown in PR31018.

I plan to add support for more operations in future patches.

Reviewers: RKSimon, zvi, delena

Subscribers: llvm-commits

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

llvm-svn: 287612
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/vector-shuffle-512-v16.ll
llvm/test/CodeGen/X86/vector-shuffle-masked.ll