diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2020-01-12 12:29:41 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2020-01-12 12:29:41 +0000 |
commit | 66e39067edbfdb1469be001ebb053530a608b532 (patch) | |
tree | 3b859f47aa9940d094c642e9d94d36d71b593c50 /llvm/lib/Target/X86 | |
parent | b375f28b0ec1129a4b94770a9c55ba49222ea1dd (diff) | |
download | bcm5719-llvm-66e39067edbfdb1469be001ebb053530a608b532.tar.gz bcm5719-llvm-66e39067edbfdb1469be001ebb053530a608b532.zip |
[X86][AVX] Use lowerShuffleAsLanePermuteAndSHUFP to lower binary v4f64 shuffles.
Only perform this if we are shuffling lower and upper lane elements across the lanes (otherwise splitting to lower xmm shuffles would be better).
This is a regression if we shuffle build_vectors due to getVectorShuffle canonicalizing 'blend of splat' build vectors, for now I've set this not to shuffle build_vector nodes at all to avoid this.
Diffstat (limited to 'llvm/lib/Target/X86')
-rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index c7a42b15cb0..2cb8fce20fe 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -15879,6 +15879,18 @@ static SDValue lowerV4F64Shuffle(const SDLoc &DL, ArrayRef<int> Mask, Zeroable, Subtarget, DAG)) return Op; + // If we have lane crossing shuffles AND they don't all come from the lower + // lane elements, lower to SHUFPD(VPERM2F128(V1, V2), VPERM2F128(V1, V2)). + // TODO: Handle BUILD_VECTOR sources which getVectorShuffle currently + // canonicalize to a blend of splat which isn't necessary for this combine. + if (is128BitLaneCrossingShuffleMask(MVT::v4f64, Mask) && + !all_of(Mask, [](int M) { return M < 2 || (4 <= M && M < 6); }) && + (V1.getOpcode() != ISD::BUILD_VECTOR) && + (V2.getOpcode() != ISD::BUILD_VECTOR)) + if (SDValue Op = lowerShuffleAsLanePermuteAndSHUFP(DL, MVT::v4f64, V1, V2, + Mask, DAG)) + return Op; + // If we have one input in place, then we can permute the other input and // blend the result. if (isShuffleMaskInputInPlace(0, Mask) || isShuffleMaskInputInPlace(1, Mask)) |