This is an archive of the discontinued LLVM Phabricator instance.

Long compile time with Polly
ClosedPublic

Authored by ssijaric on Mar 5 2015, 2:40 AM.

Details

Reviewers
zinob
grosser
Summary

We came across a case where compiling one file (of many) in a customer application took 1m24s with a Release build vs 10s with a Release+Asserts build. The problem is that RegionBase<Tr>::getNameStr() is very expensive when the region's entry or exit block doesn't have a name, which is the case in the Release build as clang doesn't preserve names. The main use of RegionBase<Tr>::getNameStr() is to generate the message string when calling dumpPassInfo. This fix just adds the checks that we are actually generating debug pass information, and thus avoids the call to RegionBase<Tr>::getNameStr() otherwise. With this change, the compile time for a Release only build goes down to 8s.

The long compile time will still be present when -debug-pass flag is used in a Release build. If that should also be fixed, perhaps we can just create an empty string upfront if NDEBUG is set and the region's entry or exit block doesn't have a name.

Diff Detail

Event Timeline

ssijaric updated this revision to Diff 21264.Mar 5 2015, 2:40 AM
ssijaric retitled this revision from to Long compile time with Polly.
ssijaric updated this object.
ssijaric edited the test plan for this revision. (Show Details)
ssijaric added reviewers: grosser, Unknown Object (User), zinob.
ssijaric added a subscriber: Unknown Object (MLST).
grosser accepted this revision.Mar 5 2015, 2:45 AM
grosser edited edge metadata.

Hi,

assuming this patch passes 'make check' it looks good to me. Feel free to commit.

You may however update the commit message. The first line to explain what problem you fix in the pass manager. You can later refer to Polly when you explain how/where you found the problem.

Tobias

This revision is now accepted and ready to land.Mar 5 2015, 2:45 AM
mcrosier closed this revision.Mar 6 2015, 8:21 AM
mcrosier added a subscriber: mcrosier.

Committed in r231485.

Sanjin, I think it would be reasonable to ask for commit rights, if you don't already have them.

See: http://llvm.org/docs/DeveloperPolicy.html#obtaining-commit-access