Skip to content

Commit 42d30df

Browse files
lukel97topperc
authored andcommitted
[RISCV] Check type is legal before combining mgather to vlse intrinsic (llvm#81107)
Otherwise we will crash since target intrinsics don't have their types legalized. Let the mgather get legalized first, then do the combine on the legal type. Fixes llvm#81088 Co-authored-by: Craig Topper <[email protected]> (cherry picked from commit 06c89bd)
1 parent 0d656f0 commit 42d30df

File tree

2 files changed

+449
-1
lines changed

2 files changed

+449
-1
lines changed

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15565,7 +15565,7 @@ SDValue RISCVTargetLowering::PerformDAGCombine(SDNode *N,
1556515565
MGN->getMemOperand(), IndexType, MGN->getExtensionType());
1556615566

1556715567
if (Index.getOpcode() == ISD::BUILD_VECTOR &&
15568-
MGN->getExtensionType() == ISD::NON_EXTLOAD) {
15568+
MGN->getExtensionType() == ISD::NON_EXTLOAD && isTypeLegal(VT)) {
1556915569
if (std::optional<VIDSequence> SimpleVID = isSimpleVIDSequence(Index);
1557015570
SimpleVID && SimpleVID->StepDenominator == 1) {
1557115571
const int64_t StepNumerator = SimpleVID->StepNumerator;

0 commit comments

Comments
 (0)