[llvm] r369136 - [X86] resolveTargetShuffleInputs - add DemandedElts variant. NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 16 11:13:23 PDT 2019


Author: rksimon
Date: Fri Aug 16 11:13:22 2019
New Revision: 369136

URL: http://llvm.org/viewvc/llvm-project?rev=369136&view=rev
Log:
[X86] resolveTargetShuffleInputs - add DemandedElts variant. NFCI.

Nothing calls this yet, everything still goes through the non (all) DemandedElts wrapper.

Modified:
    llvm/trunk/lib/Target/X86/X86ISelLowering.cpp

Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=369136&r1=369135&r2=369136&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Fri Aug 16 11:13:22 2019
@@ -7089,12 +7089,10 @@ static void resolveTargetShuffleInputsAn
 /// remaining input indices in case we now have a unary shuffle and adjust the
 /// inputs accordingly.
 /// Returns true if the target shuffle mask was decoded.
-static bool resolveTargetShuffleInputs(SDValue Op,
+static bool resolveTargetShuffleInputs(SDValue Op, const APInt &DemandedElts,
                                        SmallVectorImpl<SDValue> &Inputs,
                                        SmallVectorImpl<int> &Mask,
                                        SelectionDAG &DAG, unsigned Depth) {
-  unsigned NumElts = Op.getValueType().getVectorNumElements();
-  APInt DemandedElts = APInt::getAllOnesValue(NumElts);
   if (!setTargetShuffleZeroElements(Op, Mask, Inputs))
     if (!getFauxShuffleMask(Op, DemandedElts, Mask, Inputs, DAG, Depth))
       return false;
@@ -7103,6 +7101,15 @@ static bool resolveTargetShuffleInputs(S
   return true;
 }
 
+static bool resolveTargetShuffleInputs(SDValue Op,
+                                       SmallVectorImpl<SDValue> &Inputs,
+                                       SmallVectorImpl<int> &Mask,
+                                       SelectionDAG &DAG, unsigned Depth) {
+  unsigned NumElts = Op.getValueType().getVectorNumElements();
+  APInt DemandedElts = APInt::getAllOnesValue(NumElts);
+  return resolveTargetShuffleInputs(Op, DemandedElts, Inputs, Mask, DAG, Depth);
+}
+
 /// Returns the scalar element that will make up the ith
 /// element of the result of the vector shuffle.
 static SDValue getShuffleScalarElt(SDNode *N, unsigned Index, SelectionDAG &DAG,




More information about the llvm-commits mailing list