diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2019-02-07 17:10:49 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2019-02-07 17:10:49 +0000 |
| commit | a5c4a5e958fd497be7366a3c5feb9ccf6b7c0bf2 (patch) | |
| tree | 43a8e599297963f1d2eb012b85403dce6ea74b2f /llvm/lib | |
| parent | 4b12236f7d7cb854425954b6c7967620c2faefd4 (diff) | |
| download | bcm5719-llvm-a5c4a5e958fd497be7366a3c5feb9ccf6b7c0bf2.tar.gz bcm5719-llvm-a5c4a5e958fd497be7366a3c5feb9ccf6b7c0bf2.zip | |
[x86] split more 256/512-bit shuffles in lowering
This is intentionally a small step because it's hard to know exactly
where we might introduce a conflicting transform with the code that
tries to form wider shuffles. But I think this is safe - if we have
a wide shuffle with 2 operands, then we should do better with an
extract + narrow shuffle.
Differential Revision: https://reviews.llvm.org/D57867
llvm-svn: 353427
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index a0fe4026821..8f2a6ef6264 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -14600,7 +14600,11 @@ static SDValue lowerShuffleWithUndefHalf(const SDLoc &DL, MVT VT, SDValue V1, if (EltWidth == 32 && NumLowerHalves && HalfVT.is128BitVector() && !is128BitUnpackShuffleMask(HalfMask)) return SDValue(); - if (EltWidth == 64) + // If this is a unary shuffle (assume that the 2nd operand is + // canonicalized to undef), then we can use vpermpd. Otherwise, we + // are better off extracting the upper half of 1 operand and using a + // narrow shuffle. + if (EltWidth == 64 && V2.isUndef()) return SDValue(); } // AVX512 has efficient cross-lane shuffles for all legal 512-bit types. |

