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

This commit is contained in:
Kazu Hirata 2025-05-10 23:15:00 -07:00 committed by GitHub
parent 50e949f3cc
commit 2f69111e1a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 7 deletions

View File

@ -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);
}

View File

@ -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);
}