[llvm] [DAGCombiner][NVPTX] Avoid forming illegal-typed shuffles after type-legalization (PR #205056)
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 22 02:25:29 PDT 2026
================
@@ -24638,10 +24638,12 @@ SDValue DAGCombiner::combineInsertEltToShuffle(SDNode *N, unsigned InsIndex) {
Mask[i] = i;
}
- // Bail out if the target can not handle the shuffle we want to create.
+ // Bail out if the target can not handle the shuffle we want to create, or
+ // would create an illegal-typed shuffle after type legalization.
EVT SubVecEltVT = SubVecVT.getVectorElementType();
EVT ShufVT = EVT::getVectorVT(*DAG.getContext(), SubVecEltVT, NumMaskVals);
- if (!TLI.isShuffleMaskLegal(Mask, ShufVT))
+ if (!TLI.isShuffleMaskLegal(Mask, ShufVT) ||
+ (LegalTypes && !TLI.isTypeLegal(ShufVT)))
----------------
RKSimon wrote:
we have a lot of isShuffleMaskLegal checks - are you intending to check types on all of them individually?
https://github.com/llvm/llvm-project/pull/205056
More information about the llvm-commits
mailing list