diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-04-03 17:17:13 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-04-03 17:17:13 +0000 |
commit | 9e28dddf555c686f23a0de5336e2602b58aab7d5 (patch) | |
tree | 1ef50f6633ded9fe3307a93a1e3b6284d15d2c0b /llvm/lib/Target/X86/X86ISelLowering.cpp | |
parent | 0c27bc2e1fe3bda1be12063bdc65ca5a9ca398c6 (diff) | |
download | bcm5719-llvm-9e28dddf555c686f23a0de5336e2602b58aab7d5.tar.gz bcm5719-llvm-9e28dddf555c686f23a0de5336e2602b58aab7d5.zip |
[X86][AVX] combineHorizontalPredicateResult - support v16i16/v32i8 reduction on AVX1
Use getPMOVMSKB helper which splits v32i8 MOVMSK calls on pre-AVX2 targets.
llvm-svn: 357608
Diffstat (limited to 'llvm/lib/Target/X86/X86ISelLowering.cpp')
-rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 601c7be42b7..0ae7b5b254b 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -34301,11 +34301,8 @@ static SDValue combineHorizontalPredicateResult(SDNode *Extract, if (Match.getScalarValueSizeInBits() != BitWidth) return SDValue(); - // We require AVX2 for PMOVMSKB for v16i16/v32i8; unsigned MatchSizeInBits = Match.getValueSizeInBits(); - if (!(MatchSizeInBits == 128 || - (MatchSizeInBits == 256 && - ((Subtarget.hasAVX() && BitWidth >= 32) || Subtarget.hasAVX2())))) + if (!(MatchSizeInBits == 128 || (MatchSizeInBits == 256 && Subtarget.hasAVX()))) return SDValue(); // Make sure this isn't a vector of 1 element. The perf win from using MOVMSK @@ -34344,9 +34341,9 @@ static SDValue combineHorizontalPredicateResult(SDNode *Extract, // The setcc produces an i8 of 0/1, so extend that to the result width and // negate to get the final 0/-1 mask value. - SDValue BitcastLogicOp = DAG.getBitcast(MaskSrcVT, Match); - SDValue Movmsk = DAG.getNode(X86ISD::MOVMSK, DL, MVT::i32, BitcastLogicOp); const TargetLowering &TLI = DAG.getTargetLoweringInfo(); + SDValue BitcastLogicOp = DAG.getBitcast(MaskSrcVT, Match); + SDValue Movmsk = getPMOVMSKB(DL, BitcastLogicOp, DAG, Subtarget); EVT SetccVT = TLI.getSetCCResultType(DAG.getDataLayout(), *DAG.getContext(), MVT::i32); SDValue Setcc = DAG.getSetCC(DL, SetccVT, Movmsk, CmpC, CondCode); |