Skip to content

Store the type of each GVN value #143271

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

cjgillot
Copy link
Contributor

@cjgillot cjgillot commented Jul 1, 2025

MIR is fully typed, so type information is an integral part of what defines a value. GVN currently tries to circumvent storing types, which creates all sorts of complexities.

This PR stores the type along with the enum Value when defining a value index. This allows to simplify a lot of code.

Fixes #128094
Fixes #135128

r? @ghost for perf

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jul 1, 2025
@cjgillot
Copy link
Contributor Author

cjgillot commented Jul 1, 2025

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 1, 2025
bors added a commit that referenced this pull request Jul 1, 2025
Store the type of each GVN value

MIR is fully typed, so type information is an integral part of what defines a value. GVN currently tries to circumvent storing types, which creates all sorts of complexities.

This PR stores the type along with the enum `Value` when defining a value index. This allows to simplify a lot of code.

r? `@ghost` for perf
@bors
Copy link
Collaborator

bors commented Jul 1, 2025

⌛ Trying commit 2684875 with merge 0debe2b...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Jul 1, 2025

☀️ Try build successful - checks-actions
Build commit: 0debe2b (0debe2b1f819bc0387b12f860b7de22201171ddc)

@rust-timer

This comment has been minimized.

@cjgillot cjgillot added the A-mir-opt-GVN Area: MIR opt Global Value Numbering (GVN) label Jul 1, 2025
@Kobzol
Copy link
Member

Kobzol commented Jul 1, 2025

Note: this benchmark will be delayed a bit, because we just switched to a new benchmarking machine and I need to backfill stable benchmark results. Sorry for that! It should be done sometime tomorrow, hopefully.

@rust-log-analyzer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (0debe2b): comparison URL.

Overall result: no relevant changes - 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

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

Max RSS (memory usage)

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

Cycles

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

Binary size

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

Bootstrap: missing data
Artifact size: 372.23 MiB -> 371.76 MiB (-0.13%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 2, 2025
@cjgillot cjgillot marked this pull request as ready for review July 3, 2025 09:56
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 3, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jul 3, 2025

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@cjgillot
Copy link
Contributor Author

cjgillot commented Jul 3, 2025

r? compiler

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