From: Simon Pilgrim Date: Fri, 24 Feb 2017 15:35:52 +0000 (+0000) Subject: [X86][SSE] Target shuffle combine can try to combine up to 16 vectors X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d94a711b823cf02e8eeb181661c3e23a890b7deb;p=llvm [X86][SSE] Target shuffle combine can try to combine up to 16 vectors Noticed while profiling PR32037, the target shuffle ops were being stored in SmallVector<*,8> types but the combiner could store as many as 16 ops at maximum depth (2 per depth). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296130 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index fe67d914e14..618d7a8c561 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -5826,7 +5826,7 @@ static bool getFauxShuffleMask(SDValue N, SmallVectorImpl &Mask, static void resolveTargetShuffleInputsAndMask(SmallVectorImpl &Inputs, SmallVectorImpl &Mask) { int MaskWidth = Mask.size(); - SmallVector UsedInputs; + SmallVector UsedInputs; for (int i = 0, e = Inputs.size(); i < e; ++i) { int lo = UsedInputs.size() * MaskWidth; int hi = lo + MaskWidth; @@ -27394,8 +27394,8 @@ static bool combineX86ShufflesConstants(const SmallVectorImpl &Ops, // Extract constant bits from each source op. bool OneUseConstantOp = false; - SmallVector UndefEltsOps(NumOps); - SmallVector, 4> RawBitsOps(NumOps); + SmallVector UndefEltsOps(NumOps); + SmallVector, 16> RawBitsOps(NumOps); for (unsigned i = 0; i != NumOps; ++i) { SDValue SrcOp = Ops[i]; OneUseConstantOp |= SrcOp.hasOneUse(); @@ -27530,7 +27530,7 @@ static bool combineX86ShufflesRecursively(ArrayRef SrcOps, SDValue Input1 = (OpInputs.size() > 1 ? OpInputs[1] : SDValue()); // Add the inputs to the Ops list, avoiding duplicates. - SmallVector Ops(SrcOps.begin(), SrcOps.end()); + SmallVector Ops(SrcOps.begin(), SrcOps.end()); int InputIdx0 = -1, InputIdx1 = -1; for (int i = 0, e = Ops.size(); i < e; ++i) { @@ -27634,8 +27634,8 @@ static bool combineX86ShufflesRecursively(ArrayRef SrcOps, HasVariableMask |= isTargetShuffleVariableMask(Op.getOpcode()); // Update the list of shuffle nodes that have been combined so far. - SmallVector CombinedNodes(SrcNodes.begin(), - SrcNodes.end()); + SmallVector CombinedNodes(SrcNodes.begin(), + SrcNodes.end()); CombinedNodes.push_back(Op.getNode()); // See if we can recurse into each shuffle source op (if it's a target