diff options
author | Kazu Hirata <kazu@google.com> | 2022-06-26 19:54:41 -0700 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2022-06-26 19:54:41 -0700 |
commit | 94460f513654da2ee6e759db2804e73001818de5 (patch) | |
tree | 84420aee6e4d966daf7c77ac45b212f1c1629304 /polly | |
parent | 586fb81eee1fba4ca784d136f303b861c1dfd29c (diff) | |
download | llvm-94460f513654da2ee6e759db2804e73001818de5.zip llvm-94460f513654da2ee6e759db2804e73001818de5.tar.gz llvm-94460f513654da2ee6e759db2804e73001818de5.tar.bz2 |
Don't use Optional::hasValue (NFC)
This patch replaces x.hasValue() with x where x is contextually
convertible to bool.
Diffstat (limited to 'polly')
-rw-r--r-- | polly/lib/Transform/ManualOptimizer.cpp | 2 | ||||
-rw-r--r-- | polly/lib/Transform/MatmulOptimizer.cpp | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/polly/lib/Transform/ManualOptimizer.cpp b/polly/lib/Transform/ManualOptimizer.cpp index ef705ec..640ae0a 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 4a40fac..bad05df 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 |