[llvm] d33ba1a - [X86][AVX] getFauxShuffleMask - don't widen shuffle inputs from INSERT_SUBVECTOR(X,SHUFFLE(Y,Z))
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Sun May 31 05:26:22 PDT 2020
Author: Simon Pilgrim
Date: 2020-05-31T13:19:18+01:00
New Revision: d33ba1aa0b505e3f4c55b382f171e8cbef6a1843
URL: https://github.com/llvm/llvm-project/commit/d33ba1aa0b505e3f4c55b382f171e8cbef6a1843
DIFF: https://github.com/llvm/llvm-project/commit/d33ba1aa0b505e3f4c55b382f171e8cbef6a1843.diff
LOG: [X86][AVX] getFauxShuffleMask - don't widen shuffle inputs from INSERT_SUBVECTOR(X,SHUFFLE(Y,Z))
Don't create nodes on the fly when decoding INSERT_SUBVECTOR as faux shuffles.
Added:
Modified:
llvm/lib/Target/X86/X86ISelLowering.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index bcaf6298de33..95c9312cd772 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -7438,9 +7438,9 @@ static bool getFauxShuffleMask(SDValue N, const APInt &DemandedElts,
SubMask, DAG, Depth + 1, ResolveKnownElts))
return false;
- // Shuffle inputs must be the same size as the subvector.
+ // Subvector shuffle inputs must not be larger than the subvector.
if (llvm::any_of(SubInputs, [SubVT](SDValue Op) {
- return SubVT.getSizeInBits() != Op.getValueSizeInBits();
+ return SubVT.getSizeInBits() > Op.getValueSizeInBits();
}))
return false;
@@ -7460,14 +7460,7 @@ static bool getFauxShuffleMask(SDValue N, const APInt &DemandedElts,
}
}
Ops.push_back(Src);
- for (SDValue &SubInput : SubInputs) {
- EVT SubSVT = SubInput.getValueType().getScalarType();
- EVT AltVT = EVT::getVectorVT(*DAG.getContext(), SubSVT,
- NumSizeInBits / SubSVT.getSizeInBits());
- Ops.push_back(DAG.getNode(ISD::INSERT_SUBVECTOR, SDLoc(N), AltVT,
- DAG.getUNDEF(AltVT), SubInput,
- DAG.getIntPtrConstant(0, SDLoc(N))));
- }
+ Ops.append(SubInputs.begin(), SubInputs.end());
for (int i = 0; i != (int)NumElts; ++i)
Mask.push_back(i);
for (int i = 0; i != (int)NumSubElts; ++i) {
More information about the llvm-commits
mailing list