Skip to content
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

Re-enable fn ptr inequality test #3090

Closed
RalfJung opened this issue Sep 28, 2023 · 0 comments · Fixed by rust-lang/rust#116270
Closed

Re-enable fn ptr inequality test #3090

RalfJung opened this issue Sep 28, 2023 · 0 comments · Fixed by rust-lang/rust#116270

Comments

@RalfJung
Copy link
Member

See rust-lang/rust#109597 (comment)
Cc @cjgillot

github-actions bot pushed a commit that referenced this issue Nov 2, 2023
See through aggregates in GVN

This PR is extracted from rust-lang/rust#111344

The first 2 commit are cleanups to avoid repeated work. I propose to stop removing useless assignments as part of this pass, and let a later `SimplifyLocals` do it. This makes tests easier to read (among others).

The next 3 commits add a constant folding mechanism to the GVN pass, presented in rust-lang/rust#116012. ~This pass is designed to only use global allocations, to avoid any risk of accidental modification of the stored state.~

The following commits implement opportunistic simplifications, in particular:
- projections of aggregates: `MyStruct { x: a }.x` gets replaced by `a`, works with enums too;
- projections of arrays: `[a, b][0]` becomes `a`;
- projections of repeat expressions: `[a; N][x]` becomes `a`;
- transform arrays of equal operands into a repeat rvalue.

Fixes #3090

r? `@oli-obk`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant