Skip to content

[TOY] Extend GVN to perform local value numbering. #143333

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 13 commits into
base: master
Choose a base branch
from

Conversation

cjgillot
Copy link
Contributor

@cjgillot cjgillot commented Jul 2, 2025

This PR is more a toy than anything else, but I still think the implementation is sound.

Current GVN MIR opt can be easily extended to track values that change inside a basic block. This PR attempts that.

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 2, 2025
@rust-log-analyzer

This comment has been minimized.

@cjgillot cjgillot force-pushed the local-value-numbering branch from c7dac45 to 62766e3 Compare July 2, 2025 22:11
@rust-log-analyzer

This comment has been minimized.

@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)
test [mir-opt] tests/mir-opt/unusual_item_types.rs ... ok

failures:

---- [mir-opt] tests/mir-opt/inline_coroutine_body.rs stdout ----
256 +         _50 = &mut (_19.0: &mut std::future::Ready<()>);
257 +         _47 = copy (_19.0: &mut std::future::Ready<()>);
258 +         StorageDead(_50);
- +         _49 = Pin::<&mut std::future::Ready<()>> { pointer: copy _47 };
+ +         _49 = copy _19;
260 +         StorageDead(_49);
261 +         _46 = &mut ((*_47).0: std::option::Option<()>);
262 +         StorageLive(_51);


thread '[mir-opt] tests/mir-opt/inline_coroutine_body.rs' panicked at src/tools/compiletest/src/runtest/mir_opt.rs:84:21:
Actual MIR output differs from expected MIR output /checkout/tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-unwind.diff
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    [mir-opt] tests/mir-opt/inline_coroutine_body.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
3 participants