Skip to content

Conversation

@dianqk
Copy link
Member

@dianqk dianqk commented Dec 29, 2025

This is a more principled fix than #147886.
If using a reference at a new location is UB, the reference is not an SSA local borrow. We should only propagate borrows from SSA locals in the SSA-based GVN.

Not ready for reviewing. I haven't resolved all non-SSA borrows.

r? ghost

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 29, 2025
@rust-log-analyzer

This comment has been minimized.

@dianqk
Copy link
Member Author

dianqk commented Jan 1, 2026

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Jan 1, 2026
[DRAFT] GVN: Only propagate borrows from SSA-locals
@rust-bors

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 1, 2026
@rust-bors
Copy link

rust-bors bot commented Jan 2, 2026

☀️ Try build successful (CI)
Build commit: f23e5de (f23e5de34a174f8bd281d69038b68bf6332b1af6, parent: fcd630976c460c819c4bbcaf107d0c94501205d8)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f23e5de): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

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.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@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.3% [0.1%, 0.9%] 20
Regressions ❌
(secondary)
0.4% [0.1%, 2.0%] 27
Improvements ✅
(primary)
-0.6% [-1.2%, -0.2%] 4
Improvements ✅
(secondary)
-0.2% [-0.4%, -0.1%] 7
All ❌✅ (primary) 0.1% [-1.2%, 0.9%] 24

Max RSS (memory usage)

Results (primary -1.1%, secondary -4.7%)

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

mean range count
Regressions ❌
(primary)
2.4% [1.9%, 2.8%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.4% [-6.8%, -0.6%] 3
Improvements ✅
(secondary)
-4.7% [-6.5%, -3.7%] 3
All ❌✅ (primary) -1.1% [-6.8%, 2.8%] 5

Cycles

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

Binary size

Results (primary 0.1%, secondary 0.0%)

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

mean range count
Regressions ❌
(primary)
0.7% [0.0%, 6.9%] 11
Regressions ❌
(secondary)
0.1% [0.0%, 0.2%] 14
Improvements ✅
(primary)
-0.1% [-1.0%, -0.0%] 27
Improvements ✅
(secondary)
-0.1% [-0.1%, -0.0%] 5
All ❌✅ (primary) 0.1% [-1.0%, 6.9%] 38

Bootstrap: 475.254s -> 472.456s (-0.59%)
Artifact size: 390.85 MiB -> 390.82 MiB (-0.01%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jan 2, 2026
@dianqk
Copy link
Member Author

dianqk commented Jan 2, 2026

@bors try parent=fcd630976c460c819c4bbcaf107d0c94501205d8 @rust-timer queue

@rust-timer

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Jan 2, 2026
[DRAFT] GVN: Only propagate borrows from SSA-locals
@rust-bors

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 2, 2026
@rust-bors
Copy link

rust-bors bot commented Jan 2, 2026

☀️ Try build successful (CI)
Build commit: 2183340 (218334063dc5d70b7f9d69202bf22750167c6cbf, parent: fcd630976c460c819c4bbcaf107d0c94501205d8)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (2183340): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

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.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@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.3% [0.1%, 0.9%] 17
Regressions ❌
(secondary)
0.3% [0.1%, 0.8%] 23
Improvements ✅
(primary)
-0.6% [-1.2%, -0.2%] 4
Improvements ✅
(secondary)
-0.2% [-0.4%, -0.1%] 8
All ❌✅ (primary) 0.1% [-1.2%, 0.9%] 21

Max RSS (memory usage)

Results (primary -1.9%)

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

mean range count
Regressions ❌
(primary)
1.7% [1.7%, 1.7%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.0% [-4.6%, -0.6%] 3
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -1.9% [-4.6%, 1.7%] 4

Cycles

Results (secondary -2.3%)

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)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.3% [-2.3%, -2.3%] 1
All ❌✅ (primary) - - 0

Binary size

Results (primary 0.2%, secondary 0.1%)

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

mean range count
Regressions ❌
(primary)
0.7% [0.0%, 6.9%] 11
Regressions ❌
(secondary)
0.1% [0.0%, 0.2%] 14
Improvements ✅
(primary)
-0.2% [-0.9%, -0.0%] 11
Improvements ✅
(secondary)
-0.1% [-0.1%, -0.0%] 5
All ❌✅ (primary) 0.2% [-0.9%, 6.9%] 22

Bootstrap: 475.254s -> 472.783s (-0.52%)
Artifact size: 390.85 MiB -> 390.84 MiB (-0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

perf-regression Performance regression. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

4 participants