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

Represent MIR composite debuginfo as projections instead of aggregates #115252

Merged
merged 2 commits into from
Sep 6, 2023

Conversation

cjgillot
Copy link
Contributor

Composite debuginfo for MIR is currently represented as

debug name => Type { projection1 => place1, projection2 => place2 };

ie. a single VarDebugInfo object with that name, and its value a VarDebugInfoContents::Composite.

This PR proposes to reverse the representation to be

debug name.projection1 => place1;
debug name.projection2 => place2;

ie. multiple VarDebugInfo objects with each their projection.

This simplifies the handling of composite debuginfo by the compiler by avoiding weird nesting.

Based on #115139

@rustbot
Copy link
Collaborator

rustbot commented Aug 26, 2023

r? @davidtwco

(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. labels Aug 26, 2023
@rustbot
Copy link
Collaborator

rustbot commented Aug 26, 2023

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@cjgillot cjgillot added A-codegen Area: Code generation A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) labels Aug 27, 2023
@davidtwco
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Aug 28, 2023

📌 Commit 1cac0ae5e259e288045675553ff5d54526892d30 has been approved by davidtwco

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 28, 2023
@bors
Copy link
Contributor

bors commented Aug 28, 2023

⌛ Testing commit 1cac0ae5e259e288045675553ff5d54526892d30 with merge 94aacbc28dfbcef5b8cd22ed74718ea99015cfb8...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Aug 28, 2023

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 28, 2023
@cjgillot
Copy link
Contributor Author

No idea what failed.
@bors retry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 28, 2023
@bors
Copy link
Contributor

bors commented Aug 28, 2023

⌛ Testing commit 1cac0ae5e259e288045675553ff5d54526892d30 with merge 94c65b155804f7dbc7889935b6dea74e1318b08a...

@rust-log-analyzer

This comment has been minimized.

@bors

This comment was marked as resolved.

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 28, 2023
@bors

This comment was marked as resolved.

@bors

This comment was marked as resolved.

@davidtwco
Copy link
Member

Are you waiting on another review?

@cjgillot
Copy link
Contributor Author

cjgillot commented Sep 6, 2023

I changed the implementation a little to simplify formatting. See the first commit. Could you take a second look?
For the test failures, they appear to come from 2 different builders are 2 different places, so I have no reason to suspect them to be real.

@davidtwco
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Sep 6, 2023

📌 Commit 26c48e6 has been approved by davidtwco

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 6, 2023
@bors
Copy link
Contributor

bors commented Sep 6, 2023

⌛ Testing commit 26c48e6 with merge a5b2ac6...

@bors
Copy link
Contributor

bors commented Sep 6, 2023

☀️ Test successful - checks-actions
Approved by: davidtwco
Pushing a5b2ac6 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 6, 2023
@bors bors merged commit a5b2ac6 into rust-lang:master Sep 6, 2023
@rustbot rustbot added this to the 1.74.0 milestone Sep 6, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (a5b2ac6): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
3.9% [3.9%, 3.9%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.3% [-0.3%, -0.3%] 2
Improvements ✅
(secondary)
-0.4% [-0.4%, -0.3%] 4
All ❌✅ (primary) 1.1% [-0.3%, 3.9%] 3

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
2.2% [0.5%, 3.3%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-8.1% [-12.0%, -4.3%] 2
Improvements ✅
(secondary)
-3.2% [-3.2%, -3.2%] 1
All ❌✅ (primary) -1.9% [-12.0%, 3.3%] 5

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
3.0% [3.0%, 3.0%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.9% [-0.9%, -0.9%] 1
All ❌✅ (primary) 3.0% [3.0%, 3.0%] 1

Binary size

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.1% [0.0%, 0.6%] 71
Regressions ❌
(secondary)
0.2% [0.0%, 1.7%] 36
Improvements ✅
(primary)
-0.2% [-0.6%, -0.0%] 5
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [-0.6%, 0.6%] 76

Bootstrap: 627.776s -> 629.849s (0.33%)
Artifact size: 317.73 MiB -> 317.80 MiB (0.02%)

@rustbot rustbot added the perf-regression Performance regression. label Sep 6, 2023
@cjgillot cjgillot deleted the mir-composite branch September 6, 2023 21:26
@nnethercote
Copy link
Contributor

@cjgillot: this change regressed binary size by a small amount across many benchmarks. Was that expected? Could it be avoided?

@cjgillot
Copy link
Contributor Author

From the stats, I understand that the regression is mostly in metadata size. That can be explained by the data structure change. The representation is more general, but unfortunately less compact: it repeats the type several times. I'm not sure how to shrink it back though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants