Skip to content

Commit 06c89bd

Browse files
lukel97topperc
andauthored
[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 <craig.topper@sifive.com>
1 parent 3c42e10 commit 06c89bd

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
@@ -15833,7 +15833,7 @@ SDValue RISCVTargetLowering::PerformDAGCombine(SDNode *N,
1583315833
MGN->getMemOperand(), IndexType, MGN->getExtensionType());
1583415834

1583515835
if (Index.getOpcode() == ISD::BUILD_VECTOR &&
15836-
MGN->getExtensionType() == ISD::NON_EXTLOAD) {
15836+
MGN->getExtensionType() == ISD::NON_EXTLOAD && isTypeLegal(VT)) {
1583715837
if (std::optional<VIDSequence> SimpleVID = isSimpleVIDSequence(Index);
1583815838
SimpleVID && SimpleVID->StepDenominator == 1) {
1583915839
const int64_t StepNumerator = SimpleVID->StepNumerator;

0 commit comments

Comments
 (0)