Skip to content
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

Merged
merged 3 commits into from
Nov 27, 2024
Merged

Remove -Zfuel. #115293

merged 3 commits into from
Nov 27, 2024

Conversation

cjgillot
Copy link
Contributor

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.

@rustbot
Copy link
Collaborator

rustbot commented Aug 27, 2023

r? @wesleywiser

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 27, 2023
@rustbot
Copy link
Collaborator

rustbot commented Aug 27, 2023

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@tmiasko
Copy link
Contributor

tmiasko commented Aug 27, 2023

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).

@rust-log-analyzer

This comment has been minimized.

@JakobDegen
Copy link
Contributor

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 &muts) in which case this can be brought back and we can enforce consistent usage

@rust-log-analyzer

This comment has been minimized.

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Aug 28, 2023
@bors
Copy link
Contributor

bors commented Aug 29, 2023

☔ The latest upstream changes (presumably #112775) made this pull request unmergeable. Please resolve the merge conflicts.

@bors
Copy link
Contributor

bors commented Sep 13, 2023

☔ The latest upstream changes (presumably #115803) made this pull request unmergeable. Please resolve the merge conflicts.

@bors
Copy link
Contributor

bors commented Sep 21, 2023

☔ The latest upstream changes (presumably #116027) made this pull request unmergeable. Please resolve the merge conflicts.

@bors
Copy link
Contributor

bors commented Sep 27, 2023

☔ The latest upstream changes (presumably #116144) made this pull request unmergeable. Please resolve the merge conflicts.

@wesleywiser
Copy link
Member

wesleywiser commented Oct 5, 2023

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 -Zfuel with incremental compilation enabled could generate a warning so that devs know it could lead to other problems.

@cjgillot
Copy link
Contributor Author

cjgillot commented Oct 5, 2023

We now have a more reliable way to disable optimizations: -Zmir-enable-passes. I recommend using that one for debugging.

@bors
Copy link
Contributor

bors commented Oct 13, 2023

☔ The latest upstream changes (presumably #115964) made this pull request unmergeable. Please resolve the merge conflicts.

@workingjubilee
Copy link
Member

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 -Zfuel because we still document it as the thing to do, or do we want them to be informed as to what actually works? If we want -Zfuel to actually work, where is the PR?

Copy link
Member

@wesleywiser wesleywiser left a 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

@Dylan-DPC Dylan-DPC added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 6, 2023
@tmiasko
Copy link
Contributor

tmiasko commented Nov 11, 2023

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.

@bjorn3
Copy link
Member

bjorn3 commented Nov 26, 2023

-Zfuel is entirely unreliable with parallel rustc, right? The order in which functions get mir optimizations running is non-deterministic and thus which function sees the last fuel consumed.

@bors
Copy link
Contributor

bors commented Aug 11, 2024

☔ The latest upstream changes (presumably #128959) made this pull request unmergeable. Please resolve the merge conflicts.

@cjgillot cjgillot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 19, 2024
@bors
Copy link
Contributor

bors commented Aug 19, 2024

☔ The latest upstream changes (presumably #129261) made this pull request unmergeable. Please resolve the merge conflicts.

@bors
Copy link
Contributor

bors commented Aug 28, 2024

☔ The latest upstream changes (presumably #129691) made this pull request unmergeable. Please resolve the merge conflicts.

@bors
Copy link
Contributor

bors commented Sep 3, 2024

☔ The latest upstream changes (presumably #129777) made this pull request unmergeable. Please resolve the merge conflicts.

@nnethercote
Copy link
Contributor

It will be good to get this merged. I have some follow-up cleanups that rely on -Zfuel being removed :)

Copy link
Member

@DianQK DianQK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be good to get this merged as well. I don’t use -Zfuel, and the reliability of this option still depends on whether we remember to call consider_optimizing.

@DianQK
Copy link
Member

DianQK commented Nov 27, 2024

♥️
@bors r=wesleywiser,DianQK

@DianQK
Copy link
Member

DianQK commented Nov 27, 2024

🧐

@DianQK
Copy link
Member

DianQK commented Nov 27, 2024

@bors r=wesleywiser,DianQK

@DianQK DianQK closed this Nov 27, 2024
@DianQK DianQK reopened this Nov 27, 2024
@DianQK
Copy link
Member

DianQK commented Nov 27, 2024

@bors r=wesleywiser,DianQK

@bors
Copy link
Contributor

bors commented Nov 27, 2024

📌 Commit 982cde9 has been approved by wesleywiser,DianQK

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 27, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 27, 2024
…mpiler-errors

Rollup of 8 pull requests

Successful merges:

 - rust-lang#115293 (Remove -Zfuel.)
 - rust-lang#132605 (CI: increase timeout from 4h to 6h)
 - rust-lang#133304 (Revert diagnostics hack to fix ICE 132920)
 - rust-lang#133402 (Constify `Drop` and `Destruct`)
 - rust-lang#133458 (Fix `Result` and `Option` not getting a jump to def link generated)
 - rust-lang#133471 (gce: fix typing_mode mismatch)
 - rust-lang#133475 (`MaybeStorage` improvements)
 - rust-lang#133513 (Only ignore windows-gnu in avr-jmp-offset)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 145df3b into rust-lang:master Nov 27, 2024
12 checks passed
@rustbot rustbot added this to the 1.85.0 milestone Nov 27, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Nov 27, 2024
Rollup merge of rust-lang#115293 - cjgillot:no-fuel, r=wesleywiser,DianQK

Remove -Zfuel.

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.
@cjgillot cjgillot deleted the no-fuel branch November 27, 2024 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-mir-opt Area: MIR optimizations A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.