-
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
Remove -Zfuel. #115293
base: master
Are you sure you want to change the base?
Remove -Zfuel. #115293
Conversation
r? @wesleywiser (rustbot has picked a reviewer for you, use r? to override) |
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
I found it quite useful in the past for bisecting bugs (it could be declared incompatible with incremental compilation if that aspect is an issue). |
This comment has been minimized.
This comment has been minimized.
I agree we should remove it right now, primarily because it's usefulness is significantly diminished by inconsistent use. At some point in the future we should switch to more structured transformations (as opposed to writing to |
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #112775) made this pull request unmergeable. Please resolve the merge conflicts. |
☔ The latest upstream changes (presumably #115803) made this pull request unmergeable. Please resolve the merge conflicts. |
☔ The latest upstream changes (presumably #116027) made this pull request unmergeable. Please resolve the merge conflicts. |
☔ The latest upstream changes (presumably #116144) made this pull request unmergeable. Please resolve the merge conflicts. |
Similar to @tmiasko, I've also found this useful in the past. The point that this is inconsistently used is true, but wouldn't it be better to fix that than to remove it entirely? @pnkfelix suggested that attempting to use |
We now have a more reliable way to disable optimizations: |
☔ The latest upstream changes (presumably #115964) made this pull request unmergeable. Please resolve the merge conflicts. |
It is more important that the information in the rustc-dev-guide is actually up-to-date, and that "how to debug optimization" is easy and accurate, as people try to actually use it e.g. to analyze and debug their codegen problems. By holding on to this, we are advising much more inexperienced devs to try to make sense of a de facto useless option. So, do we want random passerby to try to use |
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.
r=me with a corresponding PR to adjust rustc-dev-guide
The -Zfuel can be used to bisect specific transformation that is incorrect. It makes it trivial to generate diff between working and broken MIR. To locate the source code that is being miscompiled and extract minimized test case. The -Zmir-enable-passes is no alternative for such use cases. It works perfectly fine even if not every single MIR optimizations uses it - just run bisection, dump MIR at the boundary, and diff between those. If for some reason the current inconsistent use is a deal breaker for others, I can prepare a pull request that will incorporate it directly into a pass manager. I don't think we should remove it without a proper replacement. |
|
FWIW, I just wrote a patch to refactor the |
@cjgillot any updates on this? thanks |
|
This comment has been minimized.
This comment has been minimized.
let const_ = Const::from_ty_const(len, self.tcx.types.usize, self.tcx); | ||
let constant = ConstOperand { span: source_info.span, const_, user_ty: None }; | ||
let constant = ConstOperand { span: DUMMY_SP, const_, user_ty: None }; |
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.
Why are we losing the spans?
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.
We usually ignore spans for constants in optimisations, as they may only be used in the unfortunate case of post-mono errors, which must not depend on optimisations running.
☔ The latest upstream changes (presumably #128959) made this pull request unmergeable. Please resolve the merge conflicts. |
☔ The latest upstream changes (presumably #129261) made this pull request unmergeable. Please resolve the merge conflicts. |
☔ The latest upstream changes (presumably #129691) made this pull request unmergeable. Please resolve the merge conflicts. |
☔ The latest upstream changes (presumably #129777) made this pull request unmergeable. Please resolve the merge conflicts. |
It will be good to get this merged. I have some follow-up cleanups that rely on |
I'm not sure this feature is used. I only found 2 references in a google search, both referring to its introduction.
Meanwhile, it's a global mutable state, untracked by incremental compilation, so incompatible with it.