diff options
author | Kazu Hirata <kazu@google.com> | 2022-11-19 15:36:50 -0800 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2022-11-19 15:36:50 -0800 |
commit | 5d1ae6346b15539421d055d3dfc94fabe0d7c558 (patch) | |
tree | a9d4574923c3c620592388506375fc03a015515e /llvm/lib/Transforms/Utils/LoopUtils.cpp | |
parent | 6ccf1d23d7a503e1b50a8acb5aa5403a311d3446 (diff) | |
download | llvm-5d1ae6346b15539421d055d3dfc94fabe0d7c558.zip llvm-5d1ae6346b15539421d055d3dfc94fabe0d7c558.tar.gz llvm-5d1ae6346b15539421d055d3dfc94fabe0d7c558.tar.bz2 |
[Analysis] Teach getOptionalIntLoopAttribute to return std::optional (NFC)
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUtils.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LoopUtils.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopUtils.cpp b/llvm/lib/Transforms/Utils/LoopUtils.cpp index 636392a..b69735a 100644 --- a/llvm/lib/Transforms/Utils/LoopUtils.cpp +++ b/llvm/lib/Transforms/Utils/LoopUtils.cpp @@ -249,11 +249,11 @@ void llvm::addStringMetadataToLoop(Loop *TheLoop, const char *StringMD, Optional<ElementCount> llvm::getOptionalElementCountLoopAttribute(const Loop *TheLoop) { - Optional<int> Width = + std::optional<int> Width = getOptionalIntLoopAttribute(TheLoop, "llvm.loop.vectorize.width"); if (Width) { - Optional<int> IsScalable = getOptionalIntLoopAttribute( + std::optional<int> IsScalable = getOptionalIntLoopAttribute( TheLoop, "llvm.loop.vectorize.scalable.enable"); return ElementCount::get(*Width, IsScalable.value_or(false)); } @@ -354,7 +354,7 @@ TransformationMode llvm::hasUnrollTransformation(const Loop *L) { if (getBooleanLoopAttribute(L, "llvm.loop.unroll.disable")) return TM_SuppressedByUser; - Optional<int> Count = + std::optional<int> Count = getOptionalIntLoopAttribute(L, "llvm.loop.unroll.count"); if (Count) return Count.value() == 1 ? TM_SuppressedByUser : TM_ForcedByUser; @@ -375,7 +375,7 @@ TransformationMode llvm::hasUnrollAndJamTransformation(const Loop *L) { if (getBooleanLoopAttribute(L, "llvm.loop.unroll_and_jam.disable")) return TM_SuppressedByUser; - Optional<int> Count = + std::optional<int> Count = getOptionalIntLoopAttribute(L, "llvm.loop.unroll_and_jam.count"); if (Count) return Count.value() == 1 ? TM_SuppressedByUser : TM_ForcedByUser; @@ -398,7 +398,7 @@ TransformationMode llvm::hasVectorizeTransformation(const Loop *L) { Optional<ElementCount> VectorizeWidth = getOptionalElementCountLoopAttribute(L); - Optional<int> InterleaveCount = + std::optional<int> InterleaveCount = getOptionalIntLoopAttribute(L, "llvm.loop.interleave.count"); // 'Forcing' vector width and interleave count to one effectively disables |