Skip to content

Commit 5415320

Browse files
committed
legalize all regular supported types from nxv1s8 to nxv8s64 without align info
1 parent 3228a96 commit 5415320

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

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

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,13 +266,21 @@ RISCVLegalizerInfo::RISCVLegalizerInfo(const RISCVSubtarget &ST)
266266
{s32, p0, s16, 16},
267267
{s32, p0, s32, 32},
268268
{p0, p0, sXLen, XLen},
269-
{nxv1s8, p0, nxv1s8, 8},
270269
{nxv2s8, p0, nxv2s8, 8},
271270
{nxv4s8, p0, nxv4s8, 8},
272271
{nxv8s8, p0, nxv8s8, 8},
273-
{nxv16s8, p0, nxv16s8, 8}})
274-
.widenScalarToNextPow2(0, /* MinSize = */ 8)
275-
.lowerIfMemSizeNotByteSizePow2();
272+
{nxv16s8, p0, nxv16s8, 8},
273+
{nxv32s8, p0, nxv32s8, 8},
274+
{nxv64s8, p0, nxv64s8, 8},
275+
{nxv2s16, p0, nxv2s16, 16},
276+
{nxv4s16, p0, nxv4s16, 16},
277+
{nxv8s16, p0, nxv8s16, 16},
278+
{nxv16s16, p0, nxv16s16, 16},
279+
{nxv32s16, p0, nxv32s16, 16},
280+
{nxv2s32, p0, nxv2s32, 32},
281+
{nxv4s32, p0, nxv4s32, 32},
282+
{nxv8s32, p0, nxv8s32, 32},
283+
{nxv16s32, p0, nxv16s32, 32}});
276284

277285
auto &ExtLoadActions =
278286
getActionDefinitionsBuilder({G_SEXTLOAD, G_ZEXTLOAD})
@@ -287,6 +295,18 @@ RISCVLegalizerInfo::RISCVLegalizerInfo(const RISCVSubtarget &ST)
287295
} else if (ST.hasStdExtD()) {
288296
LoadStoreActions.legalForTypesWithMemDesc({{s64, p0, s64, 64}});
289297
}
298+
if (ST.getELen() == 64)
299+
LoadStoreActions.legalForTypesWithMemDesc({{nxv1s8, p0, nxv1s8, 8},
300+
{nxv1s16, p0, nxv1s16, 16},
301+
{nxv1s32, p0, nxv1s32, 32}});
302+
if (ST.hasVInstructionsI64())
303+
LoadStoreActions.legalForTypesWithMemDesc({{nxv1s64, p0, nxv1s64, 64},
304+
{nxv2s64, p0, nxv2s64, 64},
305+
{nxv4s64, p0, nxv4s64, 64},
306+
{nxv8s64, p0, nxv8s64, 64}});
307+
LoadStoreActions.widenScalarToNextPow2(0, /* MinSize = */ 8)
308+
.lowerIfMemSizeNotByteSizePow2();
309+
290310
LoadStoreActions.clampScalar(0, s32, sXLen).lower();
291311
ExtLoadActions.widenScalarToNextPow2(0).clampScalar(0, s32, sXLen).lower();
292312

0 commit comments

Comments
 (0)