summaryrefslogtreecommitdiff
path: root/polly/lib
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2022-06-26 19:54:41 -0700
committerKazu Hirata <kazu@google.com>2022-06-26 19:54:41 -0700
commit94460f513654da2ee6e759db2804e73001818de5 (patch)
tree84420aee6e4d966daf7c77ac45b212f1c1629304 /polly/lib
parent586fb81eee1fba4ca784d136f303b861c1dfd29c (diff)
downloadllvm-94460f513654da2ee6e759db2804e73001818de5.tar.gz
Don't use Optional::hasValue (NFC)
This patch replaces x.hasValue() with x where x is contextually convertible to bool.
Diffstat (limited to 'polly/lib')
-rw-r--r--polly/lib/Transform/ManualOptimizer.cpp2
-rw-r--r--polly/lib/Transform/MatmulOptimizer.cpp8
2 files changed, 5 insertions, 5 deletions
diff --git a/polly/lib/Transform/ManualOptimizer.cpp b/polly/lib/Transform/ManualOptimizer.cpp
index ef705eca8740..640ae0a859af 100644
--- a/polly/lib/Transform/ManualOptimizer.cpp
+++ b/polly/lib/Transform/ManualOptimizer.cpp
@@ -42,7 +42,7 @@ static TransformationMode hasUnrollTransformation(MDNode *LoopID) {
Optional<int> Count =
getOptionalIntLoopAttribute(LoopID, "llvm.loop.unroll.count");
- if (Count.hasValue())
+ if (Count)
return Count.getValue() == 1 ? TM_SuppressedByUser : TM_ForcedByUser;
if (getBooleanLoopAttribute(LoopID, "llvm.loop.unroll.enable"))
diff --git a/polly/lib/Transform/MatmulOptimizer.cpp b/polly/lib/Transform/MatmulOptimizer.cpp
index 4a40fac0d03b..bad05dfb8ebf 100644
--- a/polly/lib/Transform/MatmulOptimizer.cpp
+++ b/polly/lib/Transform/MatmulOptimizer.cpp
@@ -570,19 +570,19 @@ static void getTargetCacheParameters(const llvm::TargetTransformInfo *TTI) {
auto L1DCache = llvm::TargetTransformInfo::CacheLevel::L1D;
auto L2DCache = llvm::TargetTransformInfo::CacheLevel::L2D;
if (FirstCacheLevelSize == -1) {
- if (TTI->getCacheSize(L1DCache).hasValue())
+ if (TTI->getCacheSize(L1DCache))
FirstCacheLevelSize = TTI->getCacheSize(L1DCache).getValue();
else
FirstCacheLevelSize = static_cast<int>(FirstCacheLevelDefaultSize);
}
if (SecondCacheLevelSize == -1) {
- if (TTI->getCacheSize(L2DCache).hasValue())
+ if (TTI->getCacheSize(L2DCache))
SecondCacheLevelSize = TTI->getCacheSize(L2DCache).getValue();
else
SecondCacheLevelSize = static_cast<int>(SecondCacheLevelDefaultSize);
}
if (FirstCacheLevelAssociativity == -1) {
- if (TTI->getCacheAssociativity(L1DCache).hasValue())
+ if (TTI->getCacheAssociativity(L1DCache))
FirstCacheLevelAssociativity =
TTI->getCacheAssociativity(L1DCache).getValue();
else
@@ -590,7 +590,7 @@ static void getTargetCacheParameters(const llvm::TargetTransformInfo *TTI) {
static_cast<int>(FirstCacheLevelDefaultAssociativity);
}
if (SecondCacheLevelAssociativity == -1) {
- if (TTI->getCacheAssociativity(L2DCache).hasValue())
+ if (TTI->getCacheAssociativity(L2DCache))
SecondCacheLevelAssociativity =
TTI->getCacheAssociativity(L2DCache).getValue();
else