Skip to content
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

Reimplement references VarDebugInfo #115030

Closed
wants to merge 5 commits into from

Conversation

cjgillot
Copy link
Contributor

This feature was removed recently in #114904 because implemented unsoundly. This PR proposes a simpler re-implementation.

We introduce an additional references field in VarDebugInfo. This additional field allows to optimize out references that are only used for debuginfo:

debug x => _1
_1 = &_2

If debuginfo is the only use of _1, this would become

debug x => &_2

For codegen, we associate the local _2 with the name *x. This is suboptimal, as most debugger won't understand that *x is a name, and not the dereference of x.

@rustbot
Copy link
Collaborator

rustbot commented Aug 20, 2023

r? @petrochenkov

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Aug 20, 2023
@rustbot
Copy link
Collaborator

rustbot commented Aug 20, 2023

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@rust-log-analyzer

This comment has been minimized.

@petrochenkov
Copy link
Contributor

petrochenkov commented Aug 22, 2023

Not sure who has expertise to review this.
r? @davidtwco maybe, as a reviewer of #114904

@rustbot rustbot assigned davidtwco and unassigned petrochenkov Aug 22, 2023
Copy link
Member

@davidtwco davidtwco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, there's obviously still the debuginfo to work out - but it looks like there's been some suggestions in Zulip for that.

@bors
Copy link
Contributor

bors commented Aug 24, 2023

☔ The latest upstream changes (presumably #115094) made this pull request unmergeable. Please resolve the merge conflicts.

@cjgillot cjgillot closed this Sep 9, 2023
@cjgillot cjgillot deleted the ref-debuginfo branch September 9, 2023 10:19
@cjgillot
Copy link
Contributor Author

cjgillot commented Sep 9, 2023

Closing until we have a solution for the codegen part.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants