Skip to content

Commit c7b0a6e

Browse files
lukel97topperc
authored andcommitted
[RISCV] Check type is legal before combining mgather to vlse intrinsic (#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 #81088 Co-authored-by: Craig Topper <craig.topper@sifive.com> (cherry picked from commit 06c89bd)
1 parent b845f06 commit c7b0a6e

File tree

2 files changed

+449
-1
lines changed

2 files changed

+449
-1
lines changed

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -15561,7 +15561,7 @@ SDValue RISCVTargetLowering::PerformDAGCombine(SDNode *N,
1556115561
MGN->getMemOperand(), IndexType, MGN->getExtensionType());
1556215562

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

0 commit comments

Comments
 (0)