diff options
author | Mircea Trofin <mtrofin@google.com> | 2025-06-18 06:40:06 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-18 06:40:06 -0700 |
commit | bdac9580f3bc341ccbeeb743ecca656756f5aaec (patch) | |
tree | 8e1a565c41928e45a982e36f0af24c9bec80d47e /llvm/lib/Transforms/Scalar/JumpThreading.cpp | |
parent | fda6b751f1b1356e65816f85fbc5b98e78337940 (diff) | |
download | llvm-bdac9580f3bc341ccbeeb743ecca656756f5aaec.zip llvm-bdac9580f3bc341ccbeeb743ecca656756f5aaec.tar.gz llvm-bdac9580f3bc341ccbeeb743ecca656756f5aaec.tar.bz2 |
[nfc][jt] Drop `std::optional` pointers (#144548)
The `std::optional` didn't add any semantics that couldn't be modeled with the pointers being `nullptr`.
Diffstat (limited to 'llvm/lib/Transforms/Scalar/JumpThreading.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/JumpThreading.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/Scalar/JumpThreading.cpp b/llvm/lib/Transforms/Scalar/JumpThreading.cpp index 37b85bf..b5dbef1 100644 --- a/llvm/lib/Transforms/Scalar/JumpThreading.cpp +++ b/llvm/lib/Transforms/Scalar/JumpThreading.cpp @@ -249,7 +249,7 @@ PreservedAnalyses JumpThreadingPass::run(Function &F, runImpl(F, &AM, &TLI, &TTI, &LVI, &AA, std::make_unique<DomTreeUpdater>( &DT, nullptr, DomTreeUpdater::UpdateStrategy::Lazy), - std::nullopt, std::nullopt); + nullptr, nullptr); if (!Changed) return PreservedAnalyses::all(); @@ -283,8 +283,8 @@ bool JumpThreadingPass::runImpl(Function &F_, FunctionAnalysisManager *FAM_, TargetTransformInfo *TTI_, LazyValueInfo *LVI_, AliasAnalysis *AA_, std::unique_ptr<DomTreeUpdater> DTU_, - std::optional<BlockFrequencyInfo *> BFI_, - std::optional<BranchProbabilityInfo *> BPI_) { + BlockFrequencyInfo *BFI_, + BranchProbabilityInfo *BPI_) { LLVM_DEBUG(dbgs() << "Jump threading on function '" << F_.getName() << "'\n"); F = &F_; FAM = FAM_; @@ -3215,7 +3215,7 @@ BranchProbabilityInfo *JumpThreadingPass::getBPI() { assert(FAM && "Can't create BPI without FunctionAnalysisManager"); BPI = FAM->getCachedResult<BranchProbabilityAnalysis>(*F); } - return *BPI; + return BPI; } BlockFrequencyInfo *JumpThreadingPass::getBFI() { @@ -3223,7 +3223,7 @@ BlockFrequencyInfo *JumpThreadingPass::getBFI() { assert(FAM && "Can't create BFI without FunctionAnalysisManager"); BFI = FAM->getCachedResult<BlockFrequencyAnalysis>(*F); } - return *BFI; + return BFI; } // Important note on validity of BPI/BFI. JumpThreading tries to preserve @@ -3237,7 +3237,7 @@ BranchProbabilityInfo *JumpThreadingPass::getOrCreateBPI(bool Force) { if (Force) BPI = runExternalAnalysis<BranchProbabilityAnalysis>(); - return *BPI; + return BPI; } BlockFrequencyInfo *JumpThreadingPass::getOrCreateBFI(bool Force) { @@ -3248,5 +3248,5 @@ BlockFrequencyInfo *JumpThreadingPass::getOrCreateBFI(bool Force) { if (Force) BFI = runExternalAnalysis<BlockFrequencyAnalysis>(); - return *BFI; + return BFI; } |