-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DFAJumpThreading] Enable the pass by default #83033
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enabling this pass by default currently causes a timeout in the stage 2 build: http://llvm-compile-time-tracker.com/show_error.php?commit=f3418c749f6060a5610020ef53a5d78e222be455
As such I can't provide up to date compile-time numbers, but the last time I tried there were unacceptably large regressions, and I don't think anything has changed since (http://llvm-compile-time-tracker.com/compare.php?from=387c1573f89117687f4b964ae3a90ea7c91a4f90&to=2a66b841e34f385331226d2b4f89fffd1840cda1&stat=instructions:u).
This pass is not production ready.
@nikic What would be acceptable compile-time numbers? |
@UsmanNadeem Given what the pass does, you should aim for 0.1% first-order impact. (IIRC the cost of the original implementation was in that ballpark.) |
The performance improvement brought by DFAJumpThreading looks fairly good to me. But it's uncertain whether we test this pass enough for correctness, especially with just few maintainance after the initial patch of DFAJumpThreading. To add it into the pipeline, I believe we need more correctness proofs apart from internal unit tests. |
I believe that enabling it by default will enable more testing, and thus uncover more bugs. We have plenty of time till the next release to fix them. |
After the recent patches to fix the compile time, the costs now look reasonable: https://llvm-compile-time-tracker.com/compare.php?from=2903df02fb3c057849aaa796a91289b01950a5f0&to=110e07154887a0c0f8705a7a3ffb2d25aa59f94f&stat=instructions:u
|
Thanks, the new compile-time numbers look a lot better! While this mostly resolves the compile-time issues for average cases, I am still concerned about the behavior of the pass in pathological cases, in particular the discussion starting at #85015 (comment). We need to make sure that even if all the early-exit conditions don't trigger, we never inspect an unreasonably large number of paths. |
Hi, what is the status of this PR? What are the next steps? |
Could we implement a threshold to limit the number of paths inspected? This could be set as a backend option. |
I have merged #96127 which changes the algorithm to reduce the number of paths inspected and also adds more limits to reduce compile time. There are some assertions triggered after the patch which I am planning to look into soon. Here is the open issue: #106083 |
Since #109511 got merged, we can proceed with this one, right? |
@nikic ping! |
Can you please rebase the PR? |
New compile-time: https://llvm-compile-time-tracker.com/compare.php?from=29b92d07746fac26cd64c914bc9c5c3833974f6d&to=bcc333192cfadbe63154294b8606fba53247c7fd&stat=instructions:u The results on CTMark look reasonable. Clang has two big regressions:
|
Change-Id: Ia13cd78498ac964cda650138d7eca83b4204b3a9
Change-Id: If0fcdb8f710af4d0f197547998d954f12ec93301
More results from llvm-opt-benchmark:
|
https://discourse.llvm.org/t/rfc-enable-dfa-jumpthreading-pass-by-default/77231