-
Notifications
You must be signed in to change notification settings - Fork 11.4k
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
[Pass Manager] Excessive scheduled passes #83469
Comments
While investigating this, I found a different compile time issue with simple-loop-unswitch and non-trivial unswitching. This one requires only a single pass invocation.
This is not a hang per se. I left this running, and after about 15m it does eventually finish. I haven't figured out if this is related to the original report, but I'm currently suspecting not as the invocation in the loop should be trivial unswitching only. |
In the multiple pass version, unswitch is producing (select i1 %c, i1 true, i1 false) - i.e. a trivial select - and loop inst simplify is cleaning it up. We're looping on that. If I adjust unswitch to eagerly clean this up, we still iterate - but with a different looking pattern. From the delta, it looks like what was previously ~8 runs of unswitch is done in a single pass, and the new iteration is between loop rotate, the loop-simplify-cfg, and then unswitch. From the look of it, the two are basically collaborating to unroll a loop - one iteration at a time. I suspect the second pattern existed before the loop-unswitch change, and just had a long enough period I didn't notice it manually. |
A correction to a previous assumption - this is not a hang. It's a very long compile, but an unmodified opt compiles this example in about 13 minutes. It is still interesting as a compile time outlier though. |
Affects LLVM 13 up to and including trunk.
Program:
Godbolt: https://godbolt.org/z/hKcezobh8
Reduced LLVM IR:
Godbolt: https://godbolt.org/z/xzr8bEx8W
From
-opt-bisect-limit=3000
it seems like it gets into a loop with these 6 passes:Found via fuzzer.
The text was updated successfully, but these errors were encountered: