This is an archive of the discontinued LLVM Phabricator instance.

Long compile time with Release build and Polly
AbandonedPublic

Authored by ssijaric on Mar 5 2015, 2:35 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 check 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 21263.Mar 5 2015, 2:35 AM
ssijaric retitled this revision from to Long compile time with Release build and Polly.
ssijaric updated this object.
ssijaric edited the test plan for this revision. (Show Details)
ssijaric added reviewers: grosser, Unknown Object (User), zinob.
ssijaric abandoned this revision.Mar 5 2015, 2:43 AM

Created D8076, with llvm-commmits as subscribers this time.