[x86] be more selective about converting 'and' to shuffle (PR37749)
authorSanjay Patel <spatel@rotateright.com>
Thu, 14 Jun 2018 19:55:02 +0000 (19:55 +0000)
committerSanjay Patel <spatel@rotateright.com>
Thu, 14 Jun 2018 19:55:02 +0000 (19:55 +0000)
commitf85ca6abee7351aa5d059d7ec241e1ac016c59fb
tree4b7acfdb05ba224862f3f987322e30d0019e5a25
parentbfa94d508686c14268d7ce2b2bd094336a7ddf4a
[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
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/avx-logic.ll