================
@@ -27493,6 +27493,65 @@ static SDValue
foldExtractSubvectorFromShuffleVector(EVT NarrowVT, SDValue Src,
return DAG.getVectorShuffle(NarrowVT, DL, NewOps[0], NewOps[1], NewMask);
}
+static SDValue foldExtractSubvectorFromConcatVectors(EVT VT, SDValue V,
+ uint64_t ExtIdx,
+ const SDLoc &DL,
+ SelectionDAG &DAG,
+ bool LegalOperations) {
+ if (V.getOpcode() != ISD::CONCAT_VECTORS)
+ return SDValue();
+
+ unsigned ExtNumElts = VT.getVectorMinNumElements();
+ EVT ConcatSrcVT = V.getOperand(0).getValueType();
+ assert(ConcatSrcVT.getVectorElementType() == VT.getVectorElementType() &&
+ "Concat and extract subvector do not change element type");
----------------
paulwalker-arm wrote:
I think the problem is the refactoring has lost the reason for the
transformation and thus it is possible to use the helper in situations where
the extract-subvector never existed? If this flexibility is not necessary then
perhaps it would be better to pass in the extract-subvector and then just
assert its operand is a concat-vector? or just not move the code?
https://github.com/llvm/llvm-project/pull/200936
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits