Skip to content

Commit 914a846

Browse files
authored
[RISCV][GISel] Don't custom legalize load/store of vector of pointers if ELEN < XLEN. (#101565)
We need to have elements than can hold a pointer sized element. No test because it crashes in LowerLoad or LowerStore now which needs to be addressed separately. I also reordered things so all the vector load/store stuff is together.
1 parent bde4ffe commit 914a846

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,11 @@ RISCVLegalizerInfo::RISCVLegalizerInfo(const RISCVSubtarget &ST)
330330

331331
// we will take the custom lowering logic if we have scalable vector types
332332
// with non-standard alignments
333-
LoadStoreActions.customIf(
334-
LegalityPredicates::any(typeIsLegalIntOrFPVec(0, IntOrFPVecTys, ST),
335-
typeIsLegalPtrVec(0, PtrVecTys, ST)));
333+
LoadStoreActions.customIf(typeIsLegalIntOrFPVec(0, IntOrFPVecTys, ST));
334+
335+
// Pointers require that XLen sized elements are legal.
336+
if (XLen <= ST.getELen())
337+
LoadStoreActions.customIf(typeIsLegalPtrVec(0, PtrVecTys, ST));
336338
}
337339

338340
LoadStoreActions.widenScalarToNextPow2(0, /* MinSize = */ 8)

0 commit comments

Comments
 (0)