Skip to content

Commit 2f69111

Browse files
[polly] Remove redundant calls to std::unique_ptr<T>::get (NFC) (#139418)
1 parent 50e949f commit 2f69111

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

polly/lib/Analysis/DependenceInfo.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,7 @@ DependenceInfoWrapperPass::getDependences(Scop *S,
992992
if (It != ScopToDepsMap.end())
993993
if (It->second) {
994994
if (It->second->getDependenceLevel() == Level)
995-
return *It->second.get();
995+
return *It->second;
996996
}
997997
return recomputeDependences(S, Level);
998998
}

polly/lib/Analysis/ScopDetection.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ void ScopDetection::detect(Function &F) {
366366

367367
// Prune non-profitable regions.
368368
for (auto &DIt : DetectionContextMap) {
369-
DetectionContext &DC = *DIt.getSecond().get();
369+
DetectionContext &DC = *DIt.getSecond();
370370
if (DC.Log.hasErrors())
371371
continue;
372372
if (!ValidRegions.count(&DC.CurRegion))
@@ -431,7 +431,7 @@ bool ScopDetection::isMaxRegionInScop(const Region &R, bool Verify) {
431431
Entry = std::make_unique<DetectionContext>(const_cast<Region &>(R), AA,
432432
/*Verifying=*/false);
433433

434-
return isValidRegion(*Entry.get());
434+
return isValidRegion(*Entry);
435435
}
436436

437437
return true;
@@ -1496,7 +1496,7 @@ Region *ScopDetection::expandRegion(Region &R) {
14961496
std::unique_ptr<DetectionContext> &Entry = DetectionContextMap[P];
14971497
Entry = std::make_unique<DetectionContext>(*ExpandedRegion, AA,
14981498
/*Verifying=*/false);
1499-
DetectionContext &Context = *Entry.get();
1499+
DetectionContext &Context = *Entry;
15001500

15011501
POLLY_DEBUG(dbgs() << "\t\tTrying " << ExpandedRegion->getNameStr()
15021502
<< "\n");
@@ -1554,7 +1554,7 @@ static bool regionWithoutLoops(Region &R, LoopInfo &LI) {
15541554
void ScopDetection::removeCachedResultsRecursively(const Region &R) {
15551555
for (auto &SubRegion : R) {
15561556
if (ValidRegions.count(SubRegion.get())) {
1557-
removeCachedResults(*SubRegion.get());
1557+
removeCachedResults(*SubRegion);
15581558
} else
15591559
removeCachedResultsRecursively(*SubRegion);
15601560
}
@@ -1568,7 +1568,7 @@ void ScopDetection::findScops(Region &R) {
15681568
std::unique_ptr<DetectionContext> &Entry =
15691569
DetectionContextMap[getBBPairForRegion(&R)];
15701570
Entry = std::make_unique<DetectionContext>(R, AA, /*Verifying=*/false);
1571-
DetectionContext &Context = *Entry.get();
1571+
DetectionContext &Context = *Entry;
15721572

15731573
bool DidBailout = true;
15741574
if (!PollyProcessUnprofitable && regionWithoutLoops(R, LI))
@@ -1834,7 +1834,7 @@ void ScopDetection::printLocations(Function &F) {
18341834

18351835
void ScopDetection::emitMissedRemarks(const Function &F) {
18361836
for (auto &DIt : DetectionContextMap) {
1837-
DetectionContext &DC = *DIt.getSecond().get();
1837+
DetectionContext &DC = *DIt.getSecond();
18381838
if (DC.Log.hasErrors())
18391839
emitRejectionRemarks(DIt.getFirst(), DC.Log, ORE);
18401840
}

0 commit comments

Comments
 (0)