Skip to content

Conversation

cjgillot
Copy link
Contributor

@cjgillot cjgillot commented Oct 9, 2025

The current implementation of StateTransform renames _0 before analyzing liveness. This is inconsistent, as a return terminator hardcodes a read of _0.

This PR proposes to perform such rename after analyzing the body, in fact after the whole transform. The implementation is not much more complicated.

@rustbot
Copy link
Collaborator

rustbot commented Oct 9, 2025

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@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 Oct 9, 2025
@rustbot
Copy link
Collaborator

rustbot commented Oct 9, 2025

r? @davidtwco

rustbot has assigned @davidtwco.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@cjgillot
Copy link
Contributor Author

cjgillot commented Oct 9, 2025

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Oct 9, 2025
Renumber return local after state transform
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 9, 2025
@rust-bors
Copy link

rust-bors bot commented Oct 9, 2025

☀️ Try build successful (CI)
Build commit: 5d28c0f (5d28c0f97153f4ce2a271c0543e8990ff8170e75, parent: 0b278a539440be291466ea463a9b6310eaf4d7bb)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (5d28c0f): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.7% [-1.3%, -0.1%] 2
All ❌✅ (primary) - - 0

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

Results (secondary -2.8%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.7% [1.7%, 1.7%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.4% [-4.0%, -2.4%] 8
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 473.191s -> 473.193s (0.00%)
Artifact size: 388.07 MiB -> 388.06 MiB (-0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 10, 2025
@davidtwco
Copy link
Member

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Oct 13, 2025

📌 Commit 6d800ae 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 Oct 13, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 13, 2025
…idtwco

Renumber return local after state transform

The current implementation of `StateTransform` renames `_0` before analyzing liveness. This is inconsistent, as a `return` terminator hardcodes a read of `_0`.

This PR proposes to perform such rename *after* analyzing the body, in fact after the whole transform. The implementation is not much more complicated.
bors added a commit that referenced this pull request Oct 13, 2025
Rollup of 7 pull requests

Successful merges:

 - #144266 (Supress swapping lhs and rhs in equality suggestion in extern macro )
 - #147471 (Assert that non-extended temporaries and `super let` bindings have scopes)
 - #147533 (Renumber return local after state transform)
 - #147566 (rewrite outlives placeholder constraints to outlives static when handling opaque types)
 - #147613 (Make logging filters work again by moving EnvFilter into its own layer)
 - #147615 (reduce calls to attr.span() in old doc attr parsing)
 - #147636 (miri subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 6dd08cb into rust-lang:master Oct 13, 2025
11 checks passed
@rustbot rustbot added this to the 1.92.0 milestone Oct 13, 2025
rust-timer added a commit that referenced this pull request Oct 13, 2025
Rollup merge of #147533 - cjgillot:coro-late-renumber, r=davidtwco

Renumber return local after state transform

The current implementation of `StateTransform` renames `_0` before analyzing liveness. This is inconsistent, as a `return` terminator hardcodes a read of `_0`.

This PR proposes to perform such rename *after* analyzing the body, in fact after the whole transform. The implementation is not much more complicated.
@cjgillot cjgillot deleted the coro-late-renumber branch October 14, 2025 01:08
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Oct 15, 2025
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#144266 (Supress swapping lhs and rhs in equality suggestion in extern macro )
 - rust-lang/rust#147471 (Assert that non-extended temporaries and `super let` bindings have scopes)
 - rust-lang/rust#147533 (Renumber return local after state transform)
 - rust-lang/rust#147566 (rewrite outlives placeholder constraints to outlives static when handling opaque types)
 - rust-lang/rust#147613 (Make logging filters work again by moving EnvFilter into its own layer)
 - rust-lang/rust#147615 (reduce calls to attr.span() in old doc attr parsing)
 - rust-lang/rust#147636 (miri subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

5 participants