Skip to content

Move Derefer before Retag #96549

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 3 commits into from
May 1, 2022
Merged

Move Derefer before Retag #96549

merged 3 commits into from
May 1, 2022

Conversation

ouz-a
Copy link
Contributor

@ouz-a ouz-a commented Apr 29, 2022

Follow up work to #96116 #95857 #95649

This moves Derefer before Retag and creates a new LocalInfo called Temp to avoid retagging created temp values.

Zulip discussion link

r? @oli-obk

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Apr 29, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 29, 2022
@rust-log-analyzer

This comment has been minimized.

@oli-obk
Copy link
Contributor

oli-obk commented Apr 29, 2022

some style nits and CI is unhappy with the src/test/run-make/const_fn_mir test

@oli-obk oli-obk added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 30, 2022
@oli-obk
Copy link
Contributor

oli-obk commented May 1, 2022

@bors r+

@bors
Copy link
Collaborator

bors commented May 1, 2022

📌 Commit d9ddb64 has been approved by oli-obk

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 1, 2022
@bors
Copy link
Collaborator

bors commented May 1, 2022

⌛ Testing commit d9ddb64 with merge 6eda764...

@bors
Copy link
Collaborator

bors commented May 1, 2022

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing 6eda764 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 1, 2022
@bors bors merged commit 6eda764 into rust-lang:master May 1, 2022
@rustbot rustbot added this to the 1.62.0 milestone May 1, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (6eda764): comparison url.

Summary:

  • Primary benchmarks: 🎉 relevant improvements found
  • Secondary benchmarks: 🎉 relevant improvements found
Regressions 😿
(primary)
Regressions 😿
(secondary)
Improvements 🎉
(primary)
Improvements 🎉
(secondary)
All 😿 🎉
(primary)
count1 0 0 20 18 20
mean2 N/A N/A -0.4% -0.4% -0.4%
max N/A N/A -0.4% -0.6% -0.4%

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

Footnotes

  1. number of relevant changes

  2. the arithmetic mean of the percent change

@@ -57,6 +57,17 @@ fn may_be_reference(ty: Ty<'_>) -> bool {
}
}

/// Determines whether or not this LocalDecl is temp, if not it needs retagging.
fn is_not_temp<'tcx>(local_decl: &LocalDecl<'tcx>) -> bool {
Copy link
Member

Choose a reason for hiding this comment

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

is_temp would be slightly clearer I think; return false inside this function is a double negation which is somewhat confusing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right, I will change this function in the next update of derefer.

@@ -1079,6 +1079,8 @@ pub enum LocalInfo<'tcx> {
/// A temporary created during the creation of an aggregate
/// (e.g. a temporary for `foo` in `MyStruct { my_field: foo }`)
AggregateTemp,
/// A temporary created during the pass `Derefer` to avoid it's retagging
Copy link
Member

Choose a reason for hiding this comment

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

(should be "its retagging"... not a big deal though)

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request May 28, 2022
…idtwco

Add validation layer for Derefer

_Follow up work to rust-lang#96549 rust-lang#96116 rust-lang#95857 #95649_

This adds validation for Derefer making sure it is always the first projection.

r? rust-lang/mir-opt
bors added a commit to rust-lang-ci/rust that referenced this pull request May 30, 2022
…twco

Add validation layer for Derefer

_Follow up work to rust-lang#96549 rust-lang#96116 rust-lang#95857 #95649_

This adds validation for Derefer making sure it is always the first projection.

r? rust-lang/mir-opt
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Jun 24, 2022
Pull Derefer before ElaborateDrops

_Follow up work to rust-lang#97025 rust-lang#96549 rust-lang#96116 rust-lang#95887 #95649_

This moves `Derefer` before `ElaborateDrops` and creates a new `Rvalue` called `VirtualRef` that allows us to bypass many constraints for `DerefTemp`.

r? `@oli-obk`
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Jun 25, 2022
Pull Derefer before ElaborateDrops

_Follow up work to rust-lang#97025 rust-lang#96549 rust-lang#96116 rust-lang#95887 #95649_

This moves `Derefer` before `ElaborateDrops` and creates a new `Rvalue` called `VirtualRef` that allows us to bypass many constraints for `DerefTemp`.

r? ``@oli-obk``
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Jul 12, 2022
Pull Derefer before ElaborateDrops

_Follow up work to rust-lang#97025 rust-lang#96549 rust-lang#96116 rust-lang#95887 #95649_

This moves `Derefer` before `ElaborateDrops` and creates a new `Rvalue` called `VirtualRef` that allows us to bypass many constraints for `DerefTemp`.

r? `@oli-obk`
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 13, 2022
Pull Derefer before ElaborateDrops

_Follow up work to rust-lang#97025 rust-lang#96549 rust-lang#96116 rust-lang#95887 #95649_

This moves `Derefer` before `ElaborateDrops` and creates a new `Rvalue` called `VirtualRef` that allows us to bypass many constraints for `DerefTemp`.

r? `@oli-obk`
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jul 18, 2022
Pull Derefer before ElaborateDrops

_Follow up work to rust-lang#97025 rust-lang#96549 rust-lang#96116 rust-lang#95887 #95649_

This moves `Derefer` before `ElaborateDrops` and creates a new `Rvalue` called `VirtualRef` that allows us to bypass many constraints for `DerefTemp`.

r? `@oli-obk`
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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.

8 participants