Skip to content

Commit 973ec1f

Browse files
committed
[RISCV] Check type is legal before combining mgather to vlse intrinsic
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#81098 Co-authored-by: <[email protected]>
1 parent bc569f6 commit 973ec1f

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

1581415814
if (Index.getOpcode() == ISD::BUILD_VECTOR &&
15815-
MGN->getExtensionType() == ISD::NON_EXTLOAD) {
15815+
MGN->getExtensionType() == ISD::NON_EXTLOAD && isTypeLegal(VT)) {
1581615816
if (std::optional<VIDSequence> SimpleVID = isSimpleVIDSequence(Index);
1581715817
SimpleVID && SimpleVID->StepDenominator == 1) {
1581815818
const int64_t StepNumerator = SimpleVID->StepNumerator;

0 commit comments

Comments
 (0)