-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Remove unused set-discriminant statements and assignments regardless of rvalue #77876
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
Conversation
tmiasko
commented
Oct 12, 2020
- Represent use counts with u32
- Unify use count visitors
- Change RemoveStatements visitor into a function
- Remove unused set-discriminant statements
- Use exhaustive match to clarify what is being optimized
- Remove unused assignments regardless of rvalue kind
r? @varkor (rust_highfive has picked a reviewer for you, use r? to override) |
@bors try @rust-timer queue |
Awaiting bors try build completion |
⌛ Trying commit 443181e9a31cf4eb006b786261b932c978940155 with merge 2fc7421b922ca95716a1e8b2863897f8f661d0e0... |
☀️ Try build successful - checks-actions, checks-azure |
Queued 2fc7421b922ca95716a1e8b2863897f8f661d0e0 with parent 8dae8cd, future comparison URL. |
Finished benchmarking try commit (2fc7421b922ca95716a1e8b2863897f8f661d0e0): comparison url. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up. @bors rollup=never |
0a63cff
to
7f17305
Compare
7f17305
to
1bb166f
Compare
r? @wesleywiser |
1bb166f
to
89314a4
Compare
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.
This looks great and I'm glad to see tests covering the new behavior!
@bors r+ |
📌 Commit 89314a4e92e4e675c10ea6db9ca3914af5a81f26 has been approved by |
⌛ Testing commit 89314a4e92e4e675c10ea6db9ca3914af5a81f26 with merge 3cff5cc956b22a8c0f810cd9009c29c0ece46e9c... |
💔 Test failed - checks-actions |
The simplify locals implementation uses two different visitors to update the locals use counts. The DeclMarker calculates the initial use counts. The StatementDeclMarker updates the use counts as statements are being removed from the block. Replace them with a single visitor that can operate in either mode, ensuring consistency of behaviour. Additionally use exhaustive match to clarify what is being optimized. No functional changes intended.
No functionl changes intended.
Update affected ui & incremental tests to use a user declared variable bindings instead of temporaries. The former are preserved because of debuginfo, the latter are not.
89314a4
to
4c3e06a
Compare
Added overflow-checks=off to the test and updated the output. |
@bors r+ |
📌 Commit 4c3e06a has been approved by |
☀️ Test successful - checks-actions |
Performance results, as expected, are an improvement on the ctfe stress test. That said, there does appear to be a regression on the cranelift codegen benchmark in LLVM -- perhaps these weren't quite unused? Any thoughts here? |
Those changes are completely boring from LLVM perspective. They remove dead code and affect size estimates accordingly. They might change the unit partitioning as a side effect. Testing locally, I do have a different unit partitioning for full builds of cranelift-codegen. I see no reason to consider this to be anything different from codegen partitioning noise. |
Ah, ok. Makes sense. Thanks for investigating! |