-
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 all ConstPropNonsense #119627
The head ref may contain hidden characters: "const_prop_lint_n\u0335o\u0335n\u0335sense"
Remove all ConstPropNonsense #119627
Conversation
Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
… r=<try> Remove all ConstPropNonsense We track all locals and projections on them ourselves within the const propagator and only use the InterpCx to actually do some low level operations or read from constants (via `OpTy` we get for said constants). r? `@RalfJung`
This comment has been minimized.
This comment has been minimized.
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (9d5fcd0): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 668.199s -> 667.062s (-0.17%) |
878f72f
to
25b70b3
Compare
This comment has been minimized.
This comment has been minimized.
Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
})?; | ||
imm.into() | ||
} | ||
}; |
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're starting to have quite a few versions of this match on rvalue
. There are already one in GVN, one in DataflowConstProp. Do you have any idea how we could deduplicate them?
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.
I have actually copied some logic almost verbatim from GVN and was wondering this myself. It's not clear to me yet if it will be an improvement, but I would like to tackle it so we can at least have an impl that we rejected.
f6b7ddb
to
7ad6b33
Compare
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
… r=<try> Remove all ConstPropNonsense We track all locals and projections on them ourselves within the const propagator and only use the InterpCx to actually do some low level operations or read from constants (via `OpTy` we get for said constants). This helps moving the const prop lint out from the normal pipeline and running it just based on borrowck information. This in turn allows us to make progress on rust-lang#108730 (comment) there are various follow up cleanups that can be done after this PR (e.g. not matching on Rvalue twice and doing binop checks twice), but lets try landing this one first. r? `@RalfJung`
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (e54d71f): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 668.966s -> 666.083s (-0.43%) |
…rojectionElem variant
…e` variant at all
5fa508e
to
1c9e621
Compare
r? compiler ralf got enough on his plate and most of this is probably not interesting to him |
// However, for now we don't generate such MIR, and this check here *has* found real | ||
// bugs (see https://github.com/rust-lang/rust/issues/115145), so we will keep rejecting | ||
// it. | ||
assert!(!layout.abi.is_uninhabited()); |
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.
Given that this is causing ICEs and needs extra work-arounds in dataflow-const-prop, I wonder if the more pragmatic choice wouldn't be to just remove the assertion.
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.
CanConstProp is only used by const_prop_lint, so IMO it makes more sense to move it over there. Then this file can be removed.
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.
I was thinking of making this file a support for the other passes that use an interpreter:
- CanConstProp;
- the Machine;
- ...
And eventually common code like arithmetic identities.
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.
That also works, but then it should be called something like const_prop_utils
and the module-level comment for the file should clarify its purpose.
The remaining comments can be addressed in follow-up PRs. I intend to look at the effects on dataflow-const-prop on my side. |
☀️ Test successful - checks-actions |
Finished benchmarking commit (68411c9): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 664.789s -> 662.082s (-0.41%) |
This reverts commit 68411c9, reversing changes made to 7ffc697. This commit was checked in as PR rust-lang#119627.
We track all locals and projections on them ourselves within the const propagator and only use the InterpCx to actually do some low level operations or read from constants (via
OpTy
we get for said constants).This helps moving the const prop lint out from the normal pipeline and running it just based on borrowck information. This in turn allows us to make progress on #108730 (comment)
there are various follow up cleanups that can be done after this PR (e.g. not matching on Rvalue twice and doing binop checks twice), but lets try landing this one first.
r? @RalfJung