Skip to content

Remove support for SwitchInt edge effects in backward dataflow #143769

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

Merged
merged 2 commits into from
Jul 12, 2025

Conversation

tmiasko
Copy link
Contributor

@tmiasko tmiasko commented Jul 11, 2025

Those effects are untested and unused. Remove them along with the implementation of BasicBlocks::switch_sources.

Fix a mix-up of a block with its predecessors in handling of SwitchInt
edge effects for backward analysis. Note that this functionality is
currently unused, so change has no practical impact.
@rustbot
Copy link
Collaborator

rustbot commented Jul 11, 2025

r? @lcnr

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

@rustbot rustbot added 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. labels Jul 11, 2025
Copy link
Member

@lqd lqd left a comment

Choose a reason for hiding this comment

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

Agreed. This partial support has confused me before when reading the dataflow engine code.

r=me with comment nit

Those effects are untested and unused. Remove them along with
the implementation of `BasicBlocks::switch_sources`.
@tmiasko tmiasko force-pushed the rm-backward-switch-int branch from f53b73f to 5b6d661 Compare July 11, 2025 08:57
@dianqk
Copy link
Member

dianqk commented Jul 11, 2025

cc @ashivaram23 #142707 (comment)

@lqd
Copy link
Member

lqd commented Jul 11, 2025

r? lqd @bors r+ rollup

@bors
Copy link
Collaborator

bors commented Jul 11, 2025

📌 Commit 5b6d661 has been approved by lqd

It is now in the queue for this repository.

@rustbot rustbot assigned lqd and unassigned lcnr Jul 11, 2025
@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 Jul 11, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jul 11, 2025
Remove support for SwitchInt edge effects in backward dataflow

Those effects are untested and unused. Remove them along with the implementation of `BasicBlocks::switch_sources`.
bors added a commit that referenced this pull request Jul 11, 2025
Rollup of 10 pull requests

Successful merges:

 - #142301 (tests: Fix duplicated-path-in-error fail with musl)
 - #143403 (Port several trait/coherence-related attributes the new attribute system)
 - #143633 (fix: correct assertion to check for 'noinline' attribute presence before removal)
 - #143647 (Clarify and expand documentation for std::sys_common dependency structure)
 - #143716 (compiler: doc/comment some codegen-for-functions interfaces)
 - #143747 (Add target maintainer information for aarch64-unknown-linux-musl)
 - #143759 (Fix typos in function names in the `target_feature` test)
 - #143767 (Bump `src/tools/x` to Edition 2024 and some cleanups)
 - #143769 (Remove support for SwitchInt edge effects in backward dataflow)
 - #143770 (build-helper: clippy fixes)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Jul 12, 2025
Rollup of 9 pull requests

Successful merges:

 - #143403 (Port several trait/coherence-related attributes the new attribute system)
 - #143633 (fix: correct assertion to check for 'noinline' attribute presence before removal)
 - #143647 (Clarify and expand documentation for std::sys_common dependency structure)
 - #143716 (compiler: doc/comment some codegen-for-functions interfaces)
 - #143747 (Add target maintainer information for aarch64-unknown-linux-musl)
 - #143759 (Fix typos in function names in the `target_feature` test)
 - #143767 (Bump `src/tools/x` to Edition 2024 and some cleanups)
 - #143769 (Remove support for SwitchInt edge effects in backward dataflow)
 - #143770 (build-helper: clippy fixes)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 1d2aa4d into rust-lang:master Jul 12, 2025
11 checks passed
@rustbot rustbot added this to the 1.90.0 milestone Jul 12, 2025
rust-timer added a commit that referenced this pull request Jul 12, 2025
Rollup merge of #143769 - tmiasko:rm-backward-switch-int, r=lqd

Remove support for SwitchInt edge effects in backward dataflow

Those effects are untested and unused. Remove them along with the implementation of `BasicBlocks::switch_sources`.
rust-bors bot added a commit that referenced this pull request Jul 12, 2025
Collect `SwitchInt` target `VariantIdx`s while building `MaybePlacesSwitchIntData`

- Filter discriminants involved in a `SwitchInt` and map their values to `VariantIdx` while building `MaybePlacesSwitchIntData` instead of in `apply_effects_in_block` using `next_discr`. This is easier after #143769.
- Use that `Vec` when handling the `otherwise` target instead of making a new `SmallVec`.

This could make `MaybeInitializedPlaces`/`MaybeUninitializedPlaces` analysis slightly more efficient, particularly after #142707.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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