Skip to content

Commit 87008e3

Browse files
committed
Use subtarget feature
1 parent 5ebdc01 commit 87008e3

File tree

5 files changed

+9
-13
lines changed

5 files changed

+9
-13
lines changed

llvm/lib/Target/AArch64/AArch64Features.td

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -894,6 +894,11 @@ def FeatureUseFixedOverScalableIfEqualCost : SubtargetFeature<"use-fixed-over-sc
894894
"UseFixedOverScalableIfEqualCost", "true",
895895
"Prefer fixed width loop vectorization over scalable if the cost-model assigns equal costs">;
896896

897+
def FeatureDisableMaximizeScalableBandwidth : SubtargetFeature< "disable-maximize-scalable-bandwidth",
898+
"DisableMaximizeScalableBandwidth", "true",
899+
"Determine the maximum scalable vector length for a loop by the "
900+
"largest scalar type rather than the smallest">;
901+
897902
// For performance reasons we prefer to use ldapr to ldapur on certain cores.
898903
def FeatureAvoidLDAPUR : SubtargetFeature<"avoid-ldapur", "AvoidLDAPUR", "true",
899904
"Prefer add+ldapr to offset ldapur">;

llvm/lib/Target/AArch64/AArch64Processors.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,7 @@ def TuneNeoverseN2 : SubtargetFeature<"neoversen2", "ARMProcFamily", "NeoverseN2
593593
FeatureALULSLFast,
594594
FeaturePostRAScheduler,
595595
FeatureEnableSelectOptimize,
596+
FeatureDisableMaximizeScalableBandwidth,
596597
FeaturePredictableSelectIsExpensive]>;
597598

598599
def TuneNeoverseN3 : SubtargetFeature<"neoversen3", "ARMProcFamily", "NeoverseN3",
@@ -626,6 +627,7 @@ def TuneNeoverseV1 : SubtargetFeature<"neoversev1", "ARMProcFamily", "NeoverseV1
626627
FeaturePostRAScheduler,
627628
FeatureEnableSelectOptimize,
628629
FeaturePredictableSelectIsExpensive,
630+
FeatureDisableMaximizeScalableBandwidth,
629631
FeatureNoSVEFPLD1R]>;
630632

631633
def TuneNeoverseV2 : SubtargetFeature<"neoversev2", "ARMProcFamily", "NeoverseV2",

llvm/lib/Target/AArch64/AArch64Subtarget.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -267,28 +267,21 @@ void AArch64Subtarget::initializeProperties(bool HasMinSize) {
267267
PrefLoopAlignment = Align(32);
268268
MaxBytesForLoopAlignment = 16;
269269
break;
270-
case NeoverseN2:
271-
ShouldMaximizeScalableVectorBandwidth = false;
272-
PrefFunctionAlignment = Align(16);
273-
PrefLoopAlignment = Align(32);
274-
MaxBytesForLoopAlignment = 16;
275-
VScaleForTuning = 1;
276-
break;
277270
case NeoverseV2:
278271
case NeoverseV3:
279272
CacheLineSize = 64;
280273
EpilogueVectorizationMinVF = 8;
281274
MaxInterleaveFactor = 4;
282275
ScatterOverhead = 13;
283276
[[fallthrough]];
277+
case NeoverseN2:
284278
case NeoverseN3:
285279
PrefFunctionAlignment = Align(16);
286280
PrefLoopAlignment = Align(32);
287281
MaxBytesForLoopAlignment = 16;
288282
VScaleForTuning = 1;
289283
break;
290284
case NeoverseV1:
291-
ShouldMaximizeScalableVectorBandwidth = false;
292285
PrefFunctionAlignment = Align(16);
293286
PrefLoopAlignment = Align(32);
294287
MaxBytesForLoopAlignment = 16;

llvm/lib/Target/AArch64/AArch64Subtarget.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ class AArch64Subtarget final : public AArch64GenSubtargetInfo {
5757
#include "AArch64GenSubtargetInfo.inc"
5858

5959
unsigned EpilogueVectorizationMinVF = 16;
60-
bool ShouldMaximizeScalableVectorBandwidth = true;
6160
uint8_t MaxInterleaveFactor = 2;
6261
uint8_t VectorInsertExtractBaseCost = 2;
6362
uint16_t CacheLineSize = 0;
@@ -252,9 +251,6 @@ class AArch64Subtarget final : public AArch64GenSubtargetInfo {
252251
unsigned getEpilogueVectorizationMinVF() const {
253252
return EpilogueVectorizationMinVF;
254253
}
255-
bool shouldMaximizeScalableVectorBandwidth() const {
256-
return ShouldMaximizeScalableVectorBandwidth;
257-
}
258254
unsigned getMaxInterleaveFactor() const { return MaxInterleaveFactor; }
259255
unsigned getVectorInsertExtractBaseCost() const;
260256
unsigned getCacheLineSize() const override { return CacheLineSize; }

llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ bool AArch64TTIImpl::shouldMaximizeVectorBandwidth(
381381

382382
return K == TargetTransformInfo::RGK_ScalableVector &&
383383
ST->isSVEorStreamingSVEAvailable() &&
384-
ST->shouldMaximizeScalableVectorBandwidth();
384+
!ST->disableMaximizeScalableBandwidth();
385385
}
386386

387387
/// Calculate the cost of materializing a 64-bit value. This helper

0 commit comments

Comments
 (0)