diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2018-12-18 16:02:23 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2018-12-18 16:02:23 +0000 |
commit | e9effe9744bda67051ab2ff0a76ecc9e99488efa (patch) | |
tree | d27c7062ef8bddd7e9fcc7b91d4788800bbbc2d4 /llvm/lib/Target | |
parent | 0a5e4eb77669253af615d4b32567897bba23642f (diff) | |
download | bcm5719-llvm-e9effe9744bda67051ab2ff0a76ecc9e99488efa.tar.gz bcm5719-llvm-e9effe9744bda67051ab2ff0a76ecc9e99488efa.zip |
[X86][SSE] Don't use 'sign bit select' vXi8 ROTL lowering for splat rotation amounts
Noticed by @spatel on D55747 - we get much better codegen if we use the regular shift expansion.
llvm-svn: 349500
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 2596a04a18d..3d8b1787bb0 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -24813,9 +24813,11 @@ static SDValue LowerRotate(SDValue Op, const X86Subtarget &Subtarget, if (0 <= CstSplatIndex) return SDValue(); + bool IsSplatAmt = DAG.isSplatValue(Amt); + // v16i8/v32i8: Split rotation into rot4/rot2/rot1 stages and select by // the amount bit. - if (EltSizeInBits == 8) { + if (EltSizeInBits == 8 && !IsSplatAmt) { // We don't need ModuloAmt here as we just peek at individual bits. MVT ExtVT = MVT::getVectorVT(MVT::i16, NumElts / 2); @@ -24882,8 +24884,7 @@ static SDValue LowerRotate(SDValue Op, const X86Subtarget &Subtarget, // Fallback for splats + all supported variable shifts. // Fallback for non-constants AVX2 vXi16 as well. - if (LegalVarShifts || (Subtarget.hasAVX2() && !ConstantAmt) || - DAG.isSplatValue(Amt)) { + if (IsSplatAmt || LegalVarShifts || (Subtarget.hasAVX2() && !ConstantAmt)) { SDValue AmtR = DAG.getConstant(EltSizeInBits, DL, VT); AmtR = DAG.getNode(ISD::SUB, DL, VT, AmtR, Amt); SDValue SHL = DAG.getNode(ISD::SHL, DL, VT, R, Amt); |