[polly] 2f69111 - [polly] Remove redundant calls to std::unique_ptr<T>::get (NFC) (#139418)

via llvm-commits llvm-commits at lists.llvm.org
Sat May 10 23:15:03 PDT 2025


Author: Kazu Hirata
Date: 2025-05-10T23:15:00-07:00
New Revision: 2f69111e1aab1192598e8b6a42cc17a1b6ee1f13

URL: https://github.com/llvm/llvm-project/commit/2f69111e1aab1192598e8b6a42cc17a1b6ee1f13
DIFF: https://github.com/llvm/llvm-project/commit/2f69111e1aab1192598e8b6a42cc17a1b6ee1f13.diff

LOG: [polly] Remove redundant calls to std::unique_ptr<T>::get (NFC) (#139418)

Added: 
    

Modified: 
    polly/lib/Analysis/DependenceInfo.cpp
    polly/lib/Analysis/ScopDetection.cpp

Removed: 
    


################################################################################
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