Conversation
|
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
| /// | ||
| /// Used by `-Zmir-opt-bisect-limit` to assign an index to each | ||
| /// optimization-pass execution candidate during this compilation. | ||
| pub mir_opt_bisect_eval_count: AtomicUsize, |
There was a problem hiding this comment.
We used to have optimization fuel in the session, but removed it in #115293
| limit: usize, | ||
| pass: &P, | ||
| ) -> bool | ||
| static MIR_OPT_BISECT_COUNT: AtomicUsize = AtomicUsize::new(0); |
There was a problem hiding this comment.
This is actually worse. This now not only breaks incr comp, but also breaks running multiple rustc sessions in the same process. Optimization fuel is not really compatible with incr comp. Perhaps we should just warn against enabling incr comp when optimization fuel is used?
There was a problem hiding this comment.
We used to have optimization fuel in the session, but removed it in #115293
So, with this comment, should we remove the counter from Session while not making this feature broken when running multiple sessions in the same process?
Perhaps we should just warn against enabling incr comp when optimization fuel is used?
Thanks, this makes sense. I'll also add a warning when -Zmir-opt-bisect-limit is used together with incremental compilation.
There was a problem hiding this comment.
should we remove the counter from Session while not making this feature broken when running multiple sessions in the same process?
If so, I would like to know some possible ways to achieve it.
There was a problem hiding this comment.
It should definitively not be a static. Putting it in the Session breaks incr comp, but I don't think there is any easy way around that.
|
This might have weird interactions with -Zthreads, but I don't see a coherent way to resolve that, apart from mandating that the parallel compiler runs everything in a deterministic order. I think the current approach is good enough for a debugging tool. squash/fixup the commits into one and then I'll approve :) |
8922a59 to
6a9357a
Compare
closes: #150910
Enable bisecting MIR optimization passes to enhance debuggability.
discussions on zulip: https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/MIR.20dump.20the.20pass.20names/with/573219207
Check it works
Sample code
Output
r? @saethlin