-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Local copy propagation #87126
Local copy propagation #87126
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 70fa3c560bb5bf31d1a0f82cbafbb60a799a9b86 with merge 59eaa76686d3d30df4d2fb84728dd625827d7c19... |
This comment has been minimized.
This comment has been minimized.
☀️ Try build successful - checks-actions |
Queued 59eaa76686d3d30df4d2fb84728dd625827d7c19 with parent a08f25a, future comparison URL. |
r? @jonas-schievink (based on github suggestion) |
Yeah, as I mention in the commit message, the main idea is based on #76723. The differences are:
|
Finished benchmarking try commit (59eaa76686d3d30df4d2fb84728dd625827d7c19): comparison url. Summary: This change led to significant mixed results 🤷 in compiler performance.
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking 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 led to changes in compiler perf. Next Steps: If you can justify the regressions found in this perf run, please indicate this with @bors rollup=never |
70fa3c5
to
f23d460
Compare
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit f23d460b103d3fee31644545bbef49dbb6eaa9b4 with merge 47f3f074c5979a08f8b69a79bc3c72ae572a19d0... |
- StorageLive(_6); // scope 0 at $DIR/simplify_try.rs:22:13: 22:14 | ||
- _6 = ((_3 as Err).0: i32); // scope 0 at $DIR/simplify_try.rs:22:13: 22:14 | ||
- StorageLive(_8); // scope 2 at $DIR/simplify_try.rs:22:37: 22:50 | ||
- StorageLive(_9); // scope 2 at $DIR/simplify_try.rs:22:48: 22:49 | ||
- _9 = _6; // scope 2 at $DIR/simplify_try.rs:22:48: 22:49 | ||
- _8 = _9; // scope 5 at $DIR/simplify_try.rs:22:37: 22:50 | ||
- StorageDead(_9); // scope 2 at $DIR/simplify_try.rs:22:49: 22:50 | ||
- ((_0 as Err).0: i32) = _8; // scope 6 at $DIR/simplify_try.rs:22:26: 22:51 | ||
+ nop; // scope 0 at $DIR/simplify_try.rs:22:13: 22:14 | ||
+ nop; // scope 0 at $DIR/simplify_try.rs:22:13: 22:14 | ||
+ nop; // scope 2 at $DIR/simplify_try.rs:22:37: 22:50 | ||
+ nop; // scope 2 at $DIR/simplify_try.rs:22:48: 22:49 | ||
+ nop; // scope 2 at $DIR/simplify_try.rs:22:48: 22:49 | ||
+ nop; // scope 5 at $DIR/simplify_try.rs:22:37: 22:50 | ||
+ nop; // scope 2 at $DIR/simplify_try.rs:22:49: 22:50 | ||
+ nop; // scope 6 at $DIR/simplify_try.rs:22:26: 22:51 | ||
discriminant(_0) = 1; // scope 6 at $DIR/simplify_try.rs:22:26: 22:51 | ||
- StorageDead(_8); // scope 2 at $DIR/simplify_try.rs:22:50: 22:51 | ||
- StorageDead(_6); // scope 0 at $DIR/simplify_try.rs:22:50: 22:51 | ||
- StorageDead(_3); // scope 0 at $DIR/simplify_try.rs:24:6: 24:7 |
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.
What would be a reason of such a large cumulative effect? As far as I can see it should be something like ((_0 as Err).0: i32) = ((_3 as Err).0: i32);
if I correctly understood that this pass only works along the/in the blocks and not over the full body
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.
Content of the diff file is entirely due to the work of destination propagation.
On the other hand, the meta diff, i.e., the diff between the diffs, is negative interaction between copy propagation turning move into copy where simplify arm identity expects a move. As a result, what what previously optimized by simplify arm identity now reaches the destination propagation.
use rustc_middle::mir::*; | ||
|
||
/// Walks MIR to find all locals that have their address taken anywhere. | ||
pub fn ever_borrowed_locals(body: &Body<'_>) -> BitSet<Local> { |
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.
Could this be used in the ssa analysis of cg_ssa?
☀️ Try build successful - checks-actions |
Queued f965efafe8e043e1b43f46c629cd1b01d6429627 with parent 331da58, future comparison URL. |
Finished benchmarking try commit (f965efafe8e043e1b43f46c629cd1b01d6429627): comparison url. Summary: This change led to significant mixed results 🤷 in compiler performance.
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking 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 led to changes in compiler perf. Next Steps: If you can justify the regressions found in this perf run, please indicate this with @bors rollup=never |
c322723
to
ea40f9d
Compare
☔ The latest upstream changes (presumably #87509) made this pull request unmergeable. Please resolve the merge conflicts. |
ea40f9d
to
ba76f5e
Compare
@bors try |
⌛ Trying commit ba76f5e8ce3c78bce3ef8e8b2b63565956fc4733 with merge 5239e46af8c42a7c122cff505a9f44a3a5fb44c5... |
This comment has been minimized.
This comment has been minimized.
☀️ Try build successful - checks-actions |
@rust-timer build 5239e46af8c42a7c122cff505a9f44a3a5fb44c5 |
Queued 5239e46af8c42a7c122cff505a9f44a3a5fb44c5 with parent 1195bea, future comparison URL. |
⌛ Trying commit b7fe965ea9868b2492cae521d49ebb43198b8849 with merge bd1ba56000b265b08adc0ce2d7a7e2f696a53214... |
☀️ Try build successful - checks-actions |
Finished benchmarking try commit (5239e46af8c42a7c122cff505a9f44a3a5fb44c5): comparison url. Summary: This change led to significant mixed results 🤷 in compiler performance.
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking 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 led to changes in compiler perf. Next Steps: If you can justify the regressions found in this perf run, please indicate this with @bors rollup=never |
@rust-timer build bd1ba56000b265b08adc0ce2d7a7e2f696a53214 |
Queued bd1ba56000b265b08adc0ce2d7a7e2f696a53214 with parent 1195bea, future comparison URL. |
Finished benchmarking try commit (bd1ba56000b265b08adc0ce2d7a7e2f696a53214): comparison url. Summary: This change led to significant mixed results 🤷 in compiler performance.
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking 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 led to changes in compiler perf. Next Steps: If you can justify the regressions found in this perf run, please indicate this with @bors rollup=never |
b7fe965
to
bebe67e
Compare
Perf comparison made while keeping partitioning fixed (by estimating size of all mono items as 1): https://perf.rust-lang.org/compare.html?start=5239e46af8c42a7c122cff505a9f44a3a5fb44c5&end=bd1ba56000b265b08adc0ce2d7a7e2f696a53214 |
No description provided.