Skip to content

Conversation

cjgillot
Copy link
Contributor

@cjgillot cjgillot commented Jul 26, 2025

The current implementation of address projections is inconsistent. Indexing semantically relies on the index' value, but the implementation uses the index' place. This PR fixes that by using ProjectionElem<VnIndex, Ty<'tcx>> instead of the raw PlaceElem<'tcx>.

This is a more principled fix than the workaround in #145030.

@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 Jul 26, 2025
@cjgillot
Copy link
Contributor Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Jul 26, 2025

⌛ Trying commit 783ac7a with merge 413faf3

To cancel the try build, run the command @bors try cancel.

rust-bors bot added a commit that referenced this pull request Jul 26, 2025
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 26, 2025
@cjgillot cjgillot changed the title Gvn index GVN: Use a VnIndex in Address projection. Jul 26, 2025
@rust-bors
Copy link

rust-bors bot commented Jul 26, 2025

☀️ Try build successful (CI)
Build commit: 413faf3 (413faf3ee16ba890d3a82bfe8255e45c0aa5a4a5, parent: 430d6eddfc6a455ca4a0137c0822a982cccd3b2b)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (413faf3): comparison URL.

Overall result: ❌ regressions - 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)
1.0% [0.4%, 1.6%] 2
Regressions ❌
(secondary)
0.8% [0.0%, 1.6%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.0% [0.4%, 1.6%] 2

Max RSS (memory usage)

Results (primary 0.1%, secondary -2.0%)

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

mean range count
Regressions ❌
(primary)
2.1% [0.7%, 3.0%] 4
Regressions ❌
(secondary)
2.4% [2.4%, 2.4%] 1
Improvements ✅
(primary)
-4.0% [-4.0%, -4.0%] 2
Improvements ✅
(secondary)
-3.5% [-4.6%, -2.2%] 3
All ❌✅ (primary) 0.1% [-4.0%, 3.0%] 6

Cycles

Results (primary -3.7%)

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

Binary size

Results (primary 0.0%, 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.1% [0.0%, 0.2%] 7
Regressions ❌
(secondary)
0.1% [0.0%, 0.2%] 2
Improvements ✅
(primary)
-0.1% [-0.2%, -0.0%] 2
Improvements ✅
(secondary)
-0.0% [-0.0%, -0.0%] 3
All ❌✅ (primary) 0.0% [-0.2%, 0.2%] 9

Bootstrap: 468.925s -> 469.927s (0.21%)
Artifact size: 374.68 MiB -> 374.75 MiB (0.02%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 26, 2025
@cjgillot
Copy link
Contributor Author

cjgillot commented Aug 8, 2025

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Aug 8, 2025
GVN: Use a VnIndex in Address projection.
@rust-bors
Copy link

rust-bors bot commented Aug 8, 2025

⌛ Trying commit 5b541ef with merge 62808a4

To cancel the try build, run the command @bors try cancel.

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

rust-bors bot commented Aug 8, 2025

☀️ Try build successful (CI)
Build commit: 62808a4 (62808a420f38bf3827045bb6522bc69d15f26c7b, parent: 2fd855fbfc8239285aa2d596f76a8cc75e17ce02)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (62808a4): 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.4% [0.1%, 1.2%] 9
Regressions ❌
(secondary)
0.5% [0.2%, 0.9%] 9
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.6% [-0.6%, -0.5%] 3
All ❌✅ (primary) 0.4% [0.1%, 1.2%] 9

Max RSS (memory usage)

Results (primary 1.2%, secondary 2.1%)

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

mean range count
Regressions ❌
(primary)
1.7% [0.5%, 3.4%] 5
Regressions ❌
(secondary)
2.1% [0.8%, 3.0%] 3
Improvements ✅
(primary)
-1.1% [-1.1%, -1.1%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.2% [-1.1%, 3.4%] 6

Cycles

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

Binary size

Results (primary -0.0%, 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.0% [0.0%, 0.0%] 5
Regressions ❌
(secondary)
0.0% [0.0%, 0.0%] 3
Improvements ✅
(primary)
-0.2% [-0.2%, -0.2%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.0% [-0.2%, 0.0%] 6

Bootstrap: 465.394s -> 465.423s (0.01%)
Artifact size: 377.41 MiB -> 377.47 MiB (0.02%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Aug 8, 2025
@bors
Copy link
Collaborator

bors commented Aug 23, 2025

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

@bors
Copy link
Collaborator

bors commented Sep 7, 2025

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

@cjgillot
Copy link
Contributor Author

cjgillot commented Sep 9, 2025

@bors try @rust-timer queue

@rustbot
Copy link
Collaborator

rustbot commented Sep 17, 2025

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Sep 17, 2025
@rustbot
Copy link
Collaborator

rustbot commented Sep 17, 2025

r? @SparrowLii

rustbot has assigned @SparrowLii.
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

@bors
Copy link
Collaborator

bors commented Sep 19, 2025

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

@rustbot

This comment has been minimized.

@SparrowLii
Copy link
Member

r? @dianqk Since they should be more familiar with gvn :)

@rustbot rustbot assigned dianqk and unassigned SparrowLii Sep 30, 2025
@rustbot
Copy link
Collaborator

rustbot commented Sep 30, 2025

Requested reviewer is already assigned to this pull request.

Please choose another assignee.

@rustbot
Copy link
Collaborator

rustbot commented Oct 4, 2025

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

Copy link
Member

@dianqk dianqk left a comment

Choose a reason for hiding this comment

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

// CHECK-LABEL: fn repeat_local(
// CHECK: _0 = copy _3
// CHECK: let mut [[ELEM:.*]]: &i32;
// CHECK: _0 = copy (*[[ELEM]]);
Copy link
Member

Choose a reason for hiding this comment

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

Should we leave a FIXME here?

Copy link
Contributor Author

@cjgillot cjgillot Oct 6, 2025

Choose a reason for hiding this comment

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

The new result is more correct, so I'd rather not. The current annotation was more of a bug: idx1 is not SSA, so we should never have been able to refer to &array[idx1].

@cjgillot
Copy link
Contributor Author

cjgillot commented Oct 6, 2025

@bors r=dianqk

@bors
Copy link
Collaborator

bors commented Oct 6, 2025

📌 Commit 3d96e54 has been approved by dianqk

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 6, 2025
@bors
Copy link
Collaborator

bors commented Oct 6, 2025

⌛ Testing commit 3d96e54 with merge 3d8c1c1...

@bors
Copy link
Collaborator

bors commented Oct 6, 2025

☀️ Test successful - checks-actions
Approved by: dianqk
Pushing 3d8c1c1 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 6, 2025
@bors bors merged commit 3d8c1c1 into rust-lang:master Oct 6, 2025
11 checks passed
@rustbot rustbot added this to the 1.92.0 milestone Oct 6, 2025
Copy link
Contributor

github-actions bot commented Oct 6, 2025

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 8111a2d (parent) -> 3d8c1c1 (this PR)

Test differences

Show 2 test diffs

2 doctest diffs were found. These are ignored, as they are noisy.

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 3d8c1c1fc077d04658de63261d8ce2903546db13 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. dist-aarch64-linux: 6400.6s -> 8556.9s (33.7%)
  2. x86_64-rust-for-linux: 3076.5s -> 2546.6s (-17.2%)
  3. aarch64-msvc-1: 7742.6s -> 6702.6s (-13.4%)
  4. x86_64-gnu-tools: 3802.2s -> 3314.7s (-12.8%)
  5. aarch64-gnu: 7037.5s -> 6247.8s (-11.2%)
  6. i686-gnu-1: 8218.4s -> 7297.5s (-11.2%)
  7. aarch64-apple: 9229.1s -> 10229.8s (10.8%)
  8. dist-x86_64-msvc: 7576.5s -> 6795.6s (-10.3%)
  9. i686-gnu-2: 6031.5s -> 5432.5s (-9.9%)
  10. x86_64-gnu-llvm-20-1: 3530.3s -> 3189.4s (-9.7%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (3d8c1c1): comparison URL.

Overall result: ❌✅ regressions and improvements - no action needed

@rustbot label: -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.6% [0.5%, 0.6%] 3
Improvements ✅
(primary)
-0.4% [-0.4%, -0.4%] 1
Improvements ✅
(secondary)
-0.0% [-0.0%, -0.0%] 1
All ❌✅ (primary) -0.4% [-0.4%, -0.4%] 1

Max RSS (memory usage)

Results (primary 5.1%, secondary 0.5%)

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

mean range count
Regressions ❌
(primary)
5.1% [2.4%, 7.8%] 2
Regressions ❌
(secondary)
4.2% [4.2%, 4.2%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.3% [-1.6%, -1.0%] 2
All ❌✅ (primary) 5.1% [2.4%, 7.8%] 2

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

Binary size

Results (primary 0.0%, 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.1% [0.0%, 0.1%] 8
Regressions ❌
(secondary)
0.1% [0.1%, 0.1%] 2
Improvements ✅
(primary)
-0.1% [-0.2%, -0.0%] 4
Improvements ✅
(secondary)
-0.1% [-0.1%, -0.0%] 2
All ❌✅ (primary) 0.0% [-0.2%, 0.1%] 12

Bootstrap: 471.909s -> 472.01s (0.02%)
Artifact size: 388.29 MiB -> 388.39 MiB (0.03%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-mir-opt Area: MIR optimizations A-mir-opt-GVN Area: MIR opt Global Value Numbering (GVN) 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.

6 participants