forked from OSchip/llvm-project
Avoid calls to dumpPassInfo and RegionBase<Tr>::getNameStr() in RGPassManager if
-debug-pass is not specified, as the string is only used when dumping pass information. There is a big cost of determining the name in ReginBase<Tr>:getNameStr() if the region's entry or exit block doesn't have a name. This is the case for the Release build, as names are not preserved by the front-end. RegionPass is mainly used by Polly, resulting in long compile time for one file of a customer application with the Release build (1m24s) vs Release+Asserts build (10s) when Polly is used. With this change, the compile time with the Release build went down to 8s. Patch by Sanjin Sijaric <ssijaric@codeaurora.org>! Phabricator: http://reviews.llvm.org/D8076 llvm-svn: 231485
This commit is contained in:
parent
dcc78ec386
commit
99b3e022c4
|
@ -83,9 +83,11 @@ bool RGPassManager::runOnFunction(Function &F) {
|
||||||
for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
|
for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
|
||||||
RegionPass *P = (RegionPass*)getContainedPass(Index);
|
RegionPass *P = (RegionPass*)getContainedPass(Index);
|
||||||
|
|
||||||
dumpPassInfo(P, EXECUTION_MSG, ON_REGION_MSG,
|
if (isPassDebuggingExecutionsOrMore()) {
|
||||||
CurrentRegion->getNameStr());
|
dumpPassInfo(P, EXECUTION_MSG, ON_REGION_MSG,
|
||||||
dumpRequiredSet(P);
|
CurrentRegion->getNameStr());
|
||||||
|
dumpRequiredSet(P);
|
||||||
|
}
|
||||||
|
|
||||||
initializeAnalysisImpl(P);
|
initializeAnalysisImpl(P);
|
||||||
|
|
||||||
|
@ -96,11 +98,13 @@ bool RGPassManager::runOnFunction(Function &F) {
|
||||||
Changed |= P->runOnRegion(CurrentRegion, *this);
|
Changed |= P->runOnRegion(CurrentRegion, *this);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Changed)
|
if (isPassDebuggingExecutionsOrMore()) {
|
||||||
dumpPassInfo(P, MODIFICATION_MSG, ON_REGION_MSG,
|
if (Changed)
|
||||||
skipThisRegion ? "<deleted>" :
|
dumpPassInfo(P, MODIFICATION_MSG, ON_REGION_MSG,
|
||||||
CurrentRegion->getNameStr());
|
skipThisRegion ? "<deleted>" :
|
||||||
dumpPreservedSet(P);
|
CurrentRegion->getNameStr());
|
||||||
|
dumpPreservedSet(P);
|
||||||
|
}
|
||||||
|
|
||||||
if (!skipThisRegion) {
|
if (!skipThisRegion) {
|
||||||
// Manually check that this region is still healthy. This is done
|
// Manually check that this region is still healthy. This is done
|
||||||
|
@ -120,8 +124,8 @@ bool RGPassManager::runOnFunction(Function &F) {
|
||||||
removeNotPreservedAnalysis(P);
|
removeNotPreservedAnalysis(P);
|
||||||
recordAvailableAnalysis(P);
|
recordAvailableAnalysis(P);
|
||||||
removeDeadPasses(P,
|
removeDeadPasses(P,
|
||||||
skipThisRegion ? "<deleted>" :
|
(!isPassDebuggingExecutionsOrMore() || skipThisRegion) ?
|
||||||
CurrentRegion->getNameStr(),
|
"<deleted>" : CurrentRegion->getNameStr(),
|
||||||
ON_REGION_MSG);
|
ON_REGION_MSG);
|
||||||
|
|
||||||
if (skipThisRegion)
|
if (skipThisRegion)
|
||||||
|
|
Loading…
Reference in New Issue