Skip to content

Commit b35d345

Browse files
committed
[AArch64] Add an option for sve-prefer-fixed-over-scalable-if-equal. NFC
Add a new option to control preferFixedOverScalableIfEqualCost, useful for testing.
1 parent f035351 commit b35d345

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ using namespace llvm::PatternMatch;
3535
static cl::opt<bool> EnableFalkorHWPFUnrollFix("enable-falkor-hwpf-unroll-fix",
3636
cl::init(true), cl::Hidden);
3737

38+
static cl::opt<bool> SVEPreferFixedOverScalableIfEqualCost(
39+
"sve-prefer-fixed-over-scalable-if-equal", cl::Hidden);
40+
3841
static cl::opt<unsigned> SVEGatherOverhead("sve-gather-overhead", cl::init(10),
3942
cl::Hidden);
4043

@@ -4919,6 +4922,12 @@ static bool containsDecreasingPointers(Loop *TheLoop,
49194922
return false;
49204923
}
49214924

4925+
bool AArch64TTIImpl::preferFixedOverScalableIfEqualCost() const {
4926+
if (SVEPreferFixedOverScalableIfEqualCost.getNumOccurrences())
4927+
return SVEPreferFixedOverScalableIfEqualCost;
4928+
return ST->useFixedOverScalableIfEqualCost();
4929+
}
4930+
49224931
unsigned AArch64TTIImpl::getEpilogueVectorizationMinVF() const {
49234932
return ST->getEpilogueVectorizationMinVF();
49244933
}

llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -387,9 +387,7 @@ class AArch64TTIImpl : public BasicTTIImplBase<AArch64TTIImpl> {
387387
return TailFoldingStyle::DataWithoutLaneMask;
388388
}
389389

390-
bool preferFixedOverScalableIfEqualCost() const {
391-
return ST->useFixedOverScalableIfEqualCost();
392-
}
390+
bool preferFixedOverScalableIfEqualCost() const;
393391

394392
unsigned getEpilogueVectorizationMinVF() const;
395393

0 commit comments

Comments
 (0)