Skip to content

Commit 52a03fb

Browse files
committed
Make the argument to getFeatureMask and isMultiversionedFunction a constant reference.
1 parent 881cb14 commit 52a03fb

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

llvm/include/llvm/Analysis/TargetTransformInfo.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1872,10 +1872,10 @@ class TargetTransformInfo {
18721872

18731873
/// Returns a bitmask constructed from the target-features or fmv-features
18741874
/// metadata of a function.
1875-
uint64_t getFeatureMask(Function &F) const;
1875+
uint64_t getFeatureMask(const Function &F) const;
18761876

18771877
/// Returns true if this is an instance of a function with multiple versions.
1878-
bool isMultiversionedFunction(Function &F) const;
1878+
bool isMultiversionedFunction(const Function &F) const;
18791879

18801880
/// \return The maximum number of function arguments the target supports.
18811881
unsigned getMaxNumArgs() const;
@@ -2319,8 +2319,8 @@ class TargetTransformInfo::Concept {
23192319
virtual VPLegalization
23202320
getVPLegalizationStrategy(const VPIntrinsic &PI) const = 0;
23212321
virtual bool hasArmWideBranch(bool Thumb) const = 0;
2322-
virtual uint64_t getFeatureMask(Function &F) const = 0;
2323-
virtual bool isMultiversionedFunction(Function &F) const = 0;
2322+
virtual uint64_t getFeatureMask(const Function &F) const = 0;
2323+
virtual bool isMultiversionedFunction(const Function &F) const = 0;
23242324
virtual unsigned getMaxNumArgs() const = 0;
23252325
virtual unsigned getNumBytesToPadGlobalArray(unsigned Size,
23262326
Type *ArrayType) const = 0;
@@ -3153,11 +3153,11 @@ class TargetTransformInfo::Model final : public TargetTransformInfo::Concept {
31533153
return Impl.hasArmWideBranch(Thumb);
31543154
}
31553155

3156-
uint64_t getFeatureMask(Function &F) const override {
3156+
uint64_t getFeatureMask(const Function &F) const override {
31573157
return Impl.getFeatureMask(F);
31583158
}
31593159

3160-
bool isMultiversionedFunction(Function &F) const override {
3160+
bool isMultiversionedFunction(const Function &F) const override {
31613161
return Impl.isMultiversionedFunction(F);
31623162
}
31633163

llvm/include/llvm/Analysis/TargetTransformInfoImpl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,9 +1039,9 @@ class TargetTransformInfoImplBase {
10391039

10401040
bool hasArmWideBranch(bool) const { return false; }
10411041

1042-
uint64_t getFeatureMask(Function &F) const { return 0; }
1042+
uint64_t getFeatureMask(const Function &F) const { return 0; }
10431043

1044-
bool isMultiversionedFunction(Function &F) const { return false; }
1044+
bool isMultiversionedFunction(const Function &F) const { return false; }
10451045

10461046
unsigned getMaxNumArgs() const { return UINT_MAX; }
10471047

llvm/lib/Analysis/TargetTransformInfo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1383,11 +1383,11 @@ bool TargetTransformInfo::hasArmWideBranch(bool Thumb) const {
13831383
return TTIImpl->hasArmWideBranch(Thumb);
13841384
}
13851385

1386-
uint64_t TargetTransformInfo::getFeatureMask(Function &F) const {
1386+
uint64_t TargetTransformInfo::getFeatureMask(const Function &F) const {
13871387
return TTIImpl->getFeatureMask(F);
13881388
}
13891389

1390-
bool TargetTransformInfo::isMultiversionedFunction(Function &F) const {
1390+
bool TargetTransformInfo::isMultiversionedFunction(const Function &F) const {
13911391
return TTIImpl->isMultiversionedFunction(F);
13921392
}
13931393

llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ static bool hasPossibleIncompatibleOps(const Function *F) {
249249
return false;
250250
}
251251

252-
uint64_t AArch64TTIImpl::getFeatureMask(Function &F) const {
252+
uint64_t AArch64TTIImpl::getFeatureMask(const Function &F) const {
253253
StringRef AttributeStr =
254254
isMultiversionedFunction(F) ? "fmv-features" : "target-features";
255255
StringRef FeatureStr = F.getFnAttribute(AttributeStr).getValueAsString();
@@ -258,7 +258,7 @@ uint64_t AArch64TTIImpl::getFeatureMask(Function &F) const {
258258
return AArch64::getFMVPriority(Features);
259259
}
260260

261-
bool AArch64TTIImpl::isMultiversionedFunction(Function &F) const {
261+
bool AArch64TTIImpl::isMultiversionedFunction(const Function &F) const {
262262
return F.hasFnAttribute("fmv-features");
263263
}
264264

llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ class AArch64TTIImpl : public BasicTTIImplBase<AArch64TTIImpl> {
8989
unsigned getInlineCallPenalty(const Function *F, const CallBase &Call,
9090
unsigned DefaultCallPenalty) const;
9191

92-
uint64_t getFeatureMask(Function &F) const;
92+
uint64_t getFeatureMask(const Function &F) const;
9393

94-
bool isMultiversionedFunction(Function &F) const;
94+
bool isMultiversionedFunction(const Function &F) const;
9595

9696
/// \name Scalar TTI Implementations
9797
/// @{

0 commit comments

Comments
 (0)