Skip to content

Commit a74859d

Browse files
committed
enable masked interleave
1 parent be6bed4 commit a74859d

File tree

5 files changed

+147
-191
lines changed

5 files changed

+147
-191
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
@@ -1359,7 +1359,9 @@ class LoopVectorizationCostModel {
13591359
return;
13601360
// Override EVL styles if needed.
13611361
// FIXME: Investigate opportunity for fixed vector factor.
1362+
// FIXME: Support interleave accesses.
13621363
bool EVLIsLegal = UserIC <= 1 && IsScalableVF &&
1364+
!InterleaveInfo.hasGroups() &&
13631365
TTI.hasActiveVectorLength() && !EnableVPlanNativePath;
13641366
if (EVLIsLegal)
13651367
return;

0 commit comments

Comments
 (0)