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

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

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.

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
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@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
Copy link
Collaborator

The job aarch64-gnu-llvm-19-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
---- [ui] tests/ui/mir/mir_query_cycle.rs stdout ----

error: test compilation failed although it shouldn't!
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/mir/mir_query_cycle.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/mir/mir_query_cycle" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2021" "-O" "--crate-type=lib"
stdout: none
--- stderr -------------------------------
error[E0733]: recursion in an async fn requires boxing
##[error]  --> /checkout/tests/ui/mir/mir_query_cycle.rs:7:1
   |
LL | pub async fn foo(count: u32) {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: a recursive `async fn` call must introduce indirection such as `Box::pin` to avoid an infinitely sized future

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0733`.
------------------------------------------

@bors
Copy link
Collaborator

bors commented Jul 1, 2025

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

@rust-timer
Copy link
Collaborator

Queued 0debe2b with parent 6988a8f, future comparison URL.
There are currently 2 preceding artifacts in the queue.
It will probably take at least ~3.1 hours until the benchmark run finishes.

@cjgillot cjgillot added the A-mir-opt-GVN Area: MIR opt Global Value Numbering (GVN) label Jul 1, 2025
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-perf Status: Waiting on a perf run to be completed. 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