[llvm] 3bb0c70 - [Scalar] Use std::optional in LoopUnrollPass.cpp (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 26 17:29:37 PST 2022
Author: Kazu Hirata
Date: 2022-11-26T17:29:32-08:00
New Revision: 3bb0c7075b8a76cf3a740b9ef95ed049f44706e3
URL: https://github.com/llvm/llvm-project/commit/3bb0c7075b8a76cf3a740b9ef95ed049f44706e3
DIFF: https://github.com/llvm/llvm-project/commit/3bb0c7075b8a76cf3a740b9ef95ed049f44706e3.diff
LOG: [Scalar] Use std::optional in LoopUnrollPass.cpp (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
Added:
Modified:
llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp b/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
index aef67bf486c5..35a1a8da8606 100644
--- a/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
@@ -64,6 +64,7 @@
#include <cassert>
#include <cstdint>
#include <limits>
+#include <optional>
#include <string>
#include <tuple>
#include <utility>
@@ -772,7 +773,7 @@ class UnrollCostEstimator {
}
};
-static Optional<unsigned>
+static std::optional<unsigned>
shouldPragmaUnroll(Loop *L, const PragmaInfo &PInfo,
const unsigned TripMultiple, const unsigned TripCount,
const UnrollCostEstimator UCE,
@@ -800,7 +801,7 @@ shouldPragmaUnroll(Loop *L, const PragmaInfo &PInfo,
return None;
}
-static Optional<unsigned> shouldFullUnroll(
+static std::optional<unsigned> shouldFullUnroll(
Loop *L, const TargetTransformInfo &TTI, DominatorTree &DT,
ScalarEvolution &SE, const SmallPtrSetImpl<const Value *> &EphValues,
const unsigned FullUnrollTripCount, const UnrollCostEstimator UCE,
@@ -830,7 +831,7 @@ static Optional<unsigned> shouldFullUnroll(
return None;
}
-static Optional<unsigned>
+static std::optional<unsigned>
shouldPartialUnroll(const unsigned LoopSize, const unsigned TripCount,
const UnrollCostEstimator UCE,
const TargetTransformInfo::UnrollingPreferences &UP) {
More information about the llvm-commits
mailing list