diff options
author | Sanjay Patel <spatel@rotateright.com> | 2018-06-14 19:55:02 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2018-06-14 19:55:02 +0000 |
commit | f85ca6abee7351aa5d059d7ec241e1ac016c59fb (patch) | |
tree | 4b7acfdb05ba224862f3f987322e30d0019e5a25 /llvm/lib | |
parent | bfa94d508686c14268d7ce2b2bd094336a7ddf4a (diff) | |
download | bcm5719-llvm-f85ca6abee7351aa5d059d7ec241e1ac016c59fb.tar.gz bcm5719-llvm-f85ca6abee7351aa5d059d7ec241e1ac016c59fb.zip |
[x86] be more selective about converting 'and' to shuffle (PR37749)
isVectorClearMaskLegal() is the TLI hook used by the generic
DAGCombiner::XformToShuffleWithZero().
We've grown to accomodate/expect this transform to shuffle
(disabling it more generally results in many regressions).
So I'm narrowly excluding the 256-bit types that clearly
are not worthwhile for AVX1.
I think in most cases we are able to recover by converting
the shuffle back into 'and' ops, but the cases in:
https://bugs.llvm.org/show_bug.cgi?id=37749
...show that there are cracks.
llvm-svn: 334759
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 9f03df35570..dc22527cf0c 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -26245,6 +26245,12 @@ bool X86TargetLowering::isShuffleMaskLegal(ArrayRef<int> M, EVT VT) const { bool X86TargetLowering::isVectorClearMaskLegal(const SmallVectorImpl<int> &Mask, EVT VT) const { + // Don't convert an 'and' into a shuffle that we don't directly support. + // vpblendw and vpshufb for 256-bit vectors are not available on AVX1. + if (!Subtarget.hasAVX2()) + if (VT == MVT::v32i8 || VT == MVT::v16i16) + return false; + // Just delegate to the generic legality, clear masks aren't special. return isShuffleMaskLegal(Mask, VT); } |