[PATCH] D35381: [DAGCombiner] Recognise vector rotations with non-splat constants

Andrew Zhogin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 15 13:18:48 PDT 2017


andrew.zhogin added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:4677
       if (RHSMask.getNode()) {
-        APInt LHSBits = APInt::getHighBitsSet(EltSizeInBits, RShVal);
+        SDValue LHSBits = buildLoHiRotateVecBitmask(LHSShiftAmt, false, DL, VT);
         Mask = DAG.getNode(ISD::AND, DL, VT, Mask,
----------------
RKSimon wrote:
> This can be done with
> ```
> SDValue LHSBits = DAG.getNode(ISD::SHL, DL, VT, AllOnes, LHSShiftAmt);
> ```
> (Taking AllOnes from the value initially assigned to Mask).
FoldConstantArithmetic is not necessary here?


https://reviews.llvm.org/D35381





More information about the llvm-commits mailing list