[polly] [polly] Remove redundant calls to std::unique_ptr<T>::get (NFC) (PR #139418)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sat May 10 16:37:24 PDT 2025
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/139418
None
>From fea372ac70bf112a55a8aa178068c69da38aa140 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Tue, 25 Mar 2025 00:24:37 -0700
Subject: [PATCH] [polly] Remove redundant calls to std::unique_ptr<T>::get
(NFC)
---
polly/lib/Analysis/DependenceInfo.cpp | 2 +-
polly/lib/Analysis/ScopDetection.cpp | 12 ++++++------
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/polly/lib/Analysis/DependenceInfo.cpp b/polly/lib/Analysis/DependenceInfo.cpp
index a530fa7b58fa6..c620f40ad0724 100644
--- a/polly/lib/Analysis/DependenceInfo.cpp
+++ b/polly/lib/Analysis/DependenceInfo.cpp
@@ -992,7 +992,7 @@ DependenceInfoWrapperPass::getDependences(Scop *S,
if (It != ScopToDepsMap.end())
if (It->second) {
if (It->second->getDependenceLevel() == Level)
- return *It->second.get();
+ return *It->second;
}
return recomputeDependences(S, Level);
}
diff --git a/polly/lib/Analysis/ScopDetection.cpp b/polly/lib/Analysis/ScopDetection.cpp
index 260211bdce31f..43ed8636b054b 100644
--- a/polly/lib/Analysis/ScopDetection.cpp
+++ b/polly/lib/Analysis/ScopDetection.cpp
@@ -366,7 +366,7 @@ void ScopDetection::detect(Function &F) {
// Prune non-profitable regions.
for (auto &DIt : DetectionContextMap) {
- DetectionContext &DC = *DIt.getSecond().get();
+ DetectionContext &DC = *DIt.getSecond();
if (DC.Log.hasErrors())
continue;
if (!ValidRegions.count(&DC.CurRegion))
@@ -431,7 +431,7 @@ bool ScopDetection::isMaxRegionInScop(const Region &R, bool Verify) {
Entry = std::make_unique<DetectionContext>(const_cast<Region &>(R), AA,
/*Verifying=*/false);
- return isValidRegion(*Entry.get());
+ return isValidRegion(*Entry);
}
return true;
@@ -1496,7 +1496,7 @@ Region *ScopDetection::expandRegion(Region &R) {
std::unique_ptr<DetectionContext> &Entry = DetectionContextMap[P];
Entry = std::make_unique<DetectionContext>(*ExpandedRegion, AA,
/*Verifying=*/false);
- DetectionContext &Context = *Entry.get();
+ DetectionContext &Context = *Entry;
POLLY_DEBUG(dbgs() << "\t\tTrying " << ExpandedRegion->getNameStr()
<< "\n");
@@ -1554,7 +1554,7 @@ static bool regionWithoutLoops(Region &R, LoopInfo &LI) {
void ScopDetection::removeCachedResultsRecursively(const Region &R) {
for (auto &SubRegion : R) {
if (ValidRegions.count(SubRegion.get())) {
- removeCachedResults(*SubRegion.get());
+ removeCachedResults(*SubRegion);
} else
removeCachedResultsRecursively(*SubRegion);
}
@@ -1568,7 +1568,7 @@ void ScopDetection::findScops(Region &R) {
std::unique_ptr<DetectionContext> &Entry =
DetectionContextMap[getBBPairForRegion(&R)];
Entry = std::make_unique<DetectionContext>(R, AA, /*Verifying=*/false);
- DetectionContext &Context = *Entry.get();
+ DetectionContext &Context = *Entry;
bool DidBailout = true;
if (!PollyProcessUnprofitable && regionWithoutLoops(R, LI))
@@ -1834,7 +1834,7 @@ void ScopDetection::printLocations(Function &F) {
void ScopDetection::emitMissedRemarks(const Function &F) {
for (auto &DIt : DetectionContextMap) {
- DetectionContext &DC = *DIt.getSecond().get();
+ DetectionContext &DC = *DIt.getSecond();
if (DC.Log.hasErrors())
emitRejectionRemarks(DIt.getFirst(), DC.Log, ORE);
}
More information about the llvm-commits
mailing list