@@ -279,13 +279,13 @@ RISCVLegalizerInfo::RISCVLegalizerInfo(const RISCVSubtarget &ST)
279
279
.clampScalar (0 , s32, (XLen == 64 || ST.hasStdExtD ()) ? s64 : s32)
280
280
.clampScalar (1 , sXLen , sXLen );
281
281
282
- auto &LoadStoreActions = getActionDefinitionsBuilder ({G_LOAD, G_STORE});
283
- if (ST.hasVInstructions ())
284
- LoadStoreActions.legalForTypesWithMemDesc ({{s32, p0, s8, 8 },
282
+ auto &LoadStoreActions = getActionDefinitionsBuilder ({G_LOAD, G_STORE}).
283
+ legalForTypesWithMemDesc ({{s32, p0, s8, 8 },
285
284
{s32, p0, s16, 16 },
286
285
{s32, p0, s32, 32 },
287
- {p0, p0, sXLen , XLen},
288
- {nxv2s8, p0, nxv2s8, 8 },
286
+ {p0, p0, sXLen , XLen}});
287
+ if (ST.hasVInstructions ())
288
+ LoadStoreActions.legalForTypesWithMemDesc ({{nxv2s8, p0, nxv2s8, 8 },
289
289
{nxv4s8, p0, nxv4s8, 8 },
290
290
{nxv8s8, p0, nxv8s8, 8 },
291
291
{nxv16s8, p0, nxv16s8, 8 },
@@ -327,13 +327,10 @@ RISCVLegalizerInfo::RISCVLegalizerInfo(const RISCVSubtarget &ST)
327
327
328
328
LoadStoreActions.widenScalarToNextPow2 (0 , /* MinSize = */ 8 )
329
329
.lowerIfMemSizeNotByteSizePow2 ()
330
- .customIf (all (LegalityPredicate ([=](const LegalityQuery &Query) {
331
- LLT Type = Query.Types [0 ];
332
- return Type.isScalableVector ();
333
- }),
334
- LegalityPredicate (LegalityPredicates::any (
335
- typeIsLegalIntOrFPVec (0 , IntOrFPVecTys, ST),
336
- typeIsLegalPtrVec (0 , PtrVecTys, ST)))))
330
+ // we will take the custom lowering logic if we have scalable vector types with non-standard alignments
331
+ .customIf (LegalityPredicate (LegalityPredicates::any (
332
+ typeIsLegalIntOrFPVec (0 , IntOrFPVecTys, ST),
333
+ typeIsLegalPtrVec (0 , PtrVecTys, ST))))
337
334
.clampScalar (0 , s32, sXLen )
338
335
.lower ();
339
336
@@ -743,10 +740,7 @@ bool RISCVLegalizerInfo::legalizeLoadStore(MachineInstr &MI,
743
740
DataTy.getElementCount ().getKnownMinValue () * (EltSizeBits / 8 );
744
741
LLT NewDataTy = LLT::scalable_vector (NumElements, 8 );
745
742
746
- if (isa<GLoad>(MI))
747
- Helper.bitcast (MI, 0 , NewDataTy);
748
- else
749
- Helper.bitcast (MI, 0 , NewDataTy);
743
+ Helper.bitcast (MI, 0 , NewDataTy);
750
744
751
745
return true ;
752
746
}
0 commit comments