-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Check whether locals are too large instead of whether accesses into them are too large #74821
Check whether locals are too large instead of whether accesses into them are too large #74821
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
b94da2b
to
74ff07e
Compare
74ff07e
to
a9725ee
Compare
@bors try @rust-timer queue |
Awaiting bors try build completion |
⌛ Trying commit a9725ee777812a379d62de197d7c1bbed4cf45eb with merge bd190279c18106147d12a444e6ae7bc861b2de24... |
☀️ Try build successful - checks-actions, checks-azure |
Queued bd190279c18106147d12a444e6ae7bc861b2de24 with parent 52d2c7a, future comparison URL. |
Finished benchmarking try commit (bd190279c18106147d12a444e6ae7bc861b2de24): 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 |
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.
LGTM! Can we add a mir-opt test showing that
let mut x = [0_u8; 5000];
x[42] = 3;
does not propagate? r=me with a test.
@bors r=wesleywiser |
📌 Commit 590885ade8a4363e1a7a75a0ffeed98236df8aa5 has been approved by |
⌛ Testing commit 590885ade8a4363e1a7a75a0ffeed98236df8aa5 with merge c0c2bd7f44ee27f17f8fbff023d61267636fa763... |
💔 Test failed - checks-actions |
590885a
to
99a85e8
Compare
@bors r=wesleywiser |
📌 Commit 99a85e811f45b7aa02d917c44c12702d007b9131 has been approved by |
☔ The latest upstream changes (presumably #74837) made this pull request unmergeable. Please resolve the merge conflicts. |
…hem are too large
We used to erase these values immediately after propagation, but some things slipped through and it caused us to still initialize huge locals.
The reason we do not trigger these lints anymore is that clippy sets the mir-opt-level to 0, and the recent changes subtly changed how the const propagator works.
303547c
to
1864a97
Compare
I made some changes to the mir-opt test suite. It now prints the name of the mir dump file it's expecting and the path to the file which requested the mir dump |
let to_full_path = |path: PathBuf| { | ||
let full = self.get_mir_dump_dir().join(&path); | ||
if !full.exists() { | ||
panic!( |
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.
👍 there are a couple other places in check_mir_dump
that also produce confusing / less useful errors but that could be fixed in a seperate pr.
@bors r+ |
📌 Commit 1864a97 has been approved by |
☀️ Test successful - checks-actions, checks-azure |
…ath, r=wesleywiser Check whether locals are too large instead of whether accesses into them are too large Essentially this stops const prop from attempting to optimize ```rust let mut x = [0_u8; 5000]; x[42] = 3; ``` I don't expect this to be a perf improvement without rust-lang#73656 (which is also where the lack of this PR will be a perf regression). r? @wesleywiser
Essentially this stops const prop from attempting to optimize
I don't expect this to be a perf improvement without #73656 (which is also where the lack of this PR will be a perf regression).
r? @wesleywiser