Skip to content

Commit e329671

Browse files
committed
enable masked interleave
1 parent d2a7f4e commit e329671

File tree

4 files changed

+128
-169
lines changed

4 files changed

+128
-169
lines changed

llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -982,8 +982,7 @@ InstructionCost RISCVTTIImpl::getInterleavedMemoryOpCost(
982982
// The interleaved memory access pass will lower interleaved memory ops (i.e
983983
// a load and store followed by a specific shuffle) to vlseg/vsseg
984984
// intrinsics.
985-
if (!UseMaskForCond && !UseMaskForGaps &&
986-
Factor <= TLI->getMaxSupportedInterleaveFactor()) {
985+
if (!UseMaskForGaps && Factor <= TLI->getMaxSupportedInterleaveFactor()) {
987986
auto *VTy = cast<VectorType>(VecTy);
988987
std::pair<InstructionCost, MVT> LT = getTypeLegalizationCost(VTy);
989988
// Need to make sure type has't been scalarized

llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,10 @@ class RISCVTTIImpl final : public BasicTTIImplBase<RISCVTTIImpl> {
398398

399399
bool enableInterleavedAccessVectorization() const override { return true; }
400400

401+
bool enableMaskedInterleavedAccessVectorization() const override {
402+
return true;
403+
}
404+
401405
unsigned getMinTripCountTailFoldingThreshold() const override;
402406

403407
enum RISCVRegisterClass { GPRRC, FPRRC, VRRC };

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,7 +1358,9 @@ class LoopVectorizationCostModel {
13581358
return;
13591359
// Override forced styles if needed.
13601360
// FIXME: Investigate opportunity for fixed vector factor.
1361+
// FIXME: Support interleave accesses.
13611362
bool EVLIsLegal = UserIC <= 1 && IsScalableVF &&
1363+
!InterleaveInfo.hasGroups() &&
13621364
TTI.hasActiveVectorLength() && !EnableVPlanNativePath;
13631365
if (EVLIsLegal)
13641366
return;

0 commit comments

Comments
 (0)