[LazyCallGraph][Inliner] Large compile-time slow down when using new pass manager
| Bugzilla Link | 35110 |
| Resolution | FIXED |
| Resolved on | Jun 30, 2021 11:25 |
| Version | trunk |
| OS | Windows NT |
| Reporter | LLVM Bugzilla Contributor |
| CC | @ekatz,@fhahn,@nemanjai,@sanjoy,@yuanfang-chen |
Extended Description
While testing the new pass manager we identified a case where one input file regressed in compile-time by ~548x.
The primary issue appears to be the call to LazyCallGraph::RefSCC::insertTrivialRefEdge() in the Inliner. If the verify() call is removed from insertTrivialRefEdge() the regression is greatly reduced.
Fixed by 468fa03
This is really unexpected (as one who never set LLVM_ENABLE_ASSERTIONS explicitly), that this flag undefines NDEBUG, and actually defines _DEBUG (on non a MSVC build). Is this the only way to enable asserts?
In any case, maybe we can move the call to "verify()" under the "#ifdef EXPENSIVE_CHECKS"? as it seems pretty expensive.
I can't reproduce it in release mode, and according to the bug description, the issue is in the call to "verify()", which is done only in debug mode. I can confirm that it is actually reproducible in debug mode, but then the debug version is much MUCH slower in many aspects that the release mode. So I'll ask, is this a real issue?
Yes I think that is an issue unfortunately. Using CMAKE_BUILD_TYPE=Release together with LLVM_ENABLE_ASSERTIONS=On is quite a common build configuration (also for various buildbots). Large compile time regressions for this config potentially impact a large number of users.
I can't reproduce it in release mode, and according to the bug description, the issue is in the call to "verify()", which is done only in debug mode. I can confirm that it is actually reproducible in debug mode, but then the debug version is much MUCH slower in many aspects that the release mode. So I'll ask, is this a real issue?
Seems that there has been no movement on this in the last couple of years. I would say that this is one of the key reasons we cannot switch to the NPM internally. If nobody more familiar with the NPM is available to resolve this, we might find some time to gain the knowledge to resolve it - but ideally someone knowledgeable can at least point us in the right direction.
We generally use dropbox/google drive and link here for large files/binaries (e.g. for lld repros)
Thanks, Davide. Creating a tar.gz got it under the limit.
We generally use dropbox/google drive and link here for large files/binaries (e.g. for lld repros)
Unfortunately, the test file exceeds the maximum allowance, so I can't attach it to the bug. Do you mind if I just send it to you directly, Chandler?