-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
[mir-opt] Allow debuginfo to be generated for a constant or a Place #73210
Conversation
r? @estebank (rust_highfive has picked a reviewer for you, use r? to override) |
@bors try @rust-timer queue |
Awaiting bors try build completion |
⌛ Trying commit e36759f0f6501606e036c97a84f80294e2f6bd3a with merge 25e92ddd8e4c25f9882f1f4d1822f1b860b3788a... |
This comment has been minimized.
This comment has been minimized.
☀️ Try build successful - checks-azure |
Queued 25e92ddd8e4c25f9882f1f4d1822f1b860b3788a with parent bb86748, future comparison URL. |
Finished benchmarking try commit (25e92ddd8e4c25f9882f1f4d1822f1b860b3788a): comparison url. |
e36759f
to
0cf171c
Compare
This comment has been minimized.
This comment has been minimized.
triage: assigning back to author to address merge conflicts. |
0cf171c
to
232f6c7
Compare
Rebased |
This comment has been minimized.
This comment has been minimized.
232f6c7
to
77f5128
Compare
Rebased and CI is passing. |
src/test/mir-opt/const_prop/aggregate/rustc.main.ConstProp.diff
Outdated
Show resolved
Hide resolved
src/test/mir-opt/const_prop/optimizes_into_variable/32bit/rustc.main.SimplifyLocals.after.mir
Outdated
Show resolved
Hide resolved
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.
r=me but maybe @oli-obk should take a look at the const-prop changes, I'm not sure what "only within the same block" propagation does.
77f5128
to
7493d7c
Compare
The debuginfo tests need updating now, too |
☔ The latest upstream changes (presumably #68965) made this pull request unmergeable. Please resolve the merge conflicts. Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:
|
@wesleywiser any updates? |
52640f2
to
8a59449
Compare
I still can't repro this locally but I'm starting to wonder if this has something to do with the version of gdb being tested. My local version of gdb is quite a bit newer than the one being tested on the failing platform (7.10). I'm trying to see if I can get that version from my distro to test with. |
Prior to this commit, debuginfo was always generated by mapping a name to a Place. This has the side-effect that `SimplifyLocals` cannot remove locals that are only used for debuginfo because their other uses have been const-propagated. To allow these locals to be removed, we now allow debuginfo to point to a constant value. The `ConstProp` pass detects when debuginfo points to a local with a known constant value and replaces it with the value. This allows the later `SimplifyLocals` pass to remove the local.
8a59449
to
01aec8d
Compare
It doesn't seem the issue is merely the version of gdb as a similarly old version works fine on Linux. I will still try to get a repro on Windows but in the meantime I'd like to go ahead and merge this with the pass disabled by default. I've had to rebase this a few times now and the PR is just large enough to be a bit unpleasant when rebasing. Once the @oli-obk does that seem fine to you? |
bcc06a5
to
3d6548c
Compare
yes that seems perfectly reasonable to me |
It doesn't work correctly on *-pc-windows-gnu
3d6548c
to
0b18ed8
Compare
Tests are blessed. |
@bors r+ |
📌 Commit 0b18ed8 has been approved by |
☀️ Test successful - checks-actions |
Prior to this commit, debuginfo was always generated by mapping a name
to a Place. This has the side-effect that
SimplifyLocals
cannot removelocals that are only used for debuginfo because their other uses have
been const-propagated.
To allow these locals to be removed, we now allow debuginfo to point to
a constant value. The
ConstProp
pass detects when debuginfo points toa local with a known constant value and replaces it with the value. This
allows the later
SimplifyLocals
pass to remove the local.