From f4cd64f24682e362d561d2f9e2ed00db187f5202 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Fri, 16 Aug 2019 18:13:22 +0000 Subject: [PATCH] [X86] resolveTargetShuffleInputs - add DemandedElts variant. NFCI. Nothing calls this yet, everything still goes through the non (all) DemandedElts wrapper. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369136 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86ISelLowering.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index a6131f9e4b5..c9e3390c5d1 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -7089,12 +7089,10 @@ static void resolveTargetShuffleInputsAndMask(SmallVectorImpl &Inputs, /// 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 &Inputs, SmallVectorImpl &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(SDValue Op, return true; } +static bool resolveTargetShuffleInputs(SDValue Op, + SmallVectorImpl &Inputs, + SmallVectorImpl &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, -- 2.49.0