Skip to content

Collect SwitchInt target VariantIdxs while building MaybePlacesSwitchIntData #143852

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

Conversation

ashivaram23
Copy link
Contributor

@ashivaram23 ashivaram23 commented Jul 12, 2025

This could make MaybeInitializedPlaces/MaybeUninitializedPlaces analysis slightly more efficient, particularly after #142707.

@rustbot
Copy link
Collaborator

rustbot commented Jul 12, 2025

r? @oli-obk

rustbot has assigned @oli-obk.
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 12, 2025
@ashivaram23
Copy link
Contributor Author

Note: I don't imagine this will have a major perf impact unless there's an enum with a hundred variants. I also don't expect this to fix the regressions from #142707 which I believe are largely from how the generated code interacts with later passes and LLVM.

@compiler-errors
Copy link
Member

Let's see what perf says anyways

@bors2 try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

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

@rust-bors
Copy link

rust-bors bot commented Jul 12, 2025

⌛ Trying commit 04c8592 with merge 8494e68

To cancel the try build, run the command @bors2 try cancel.

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.
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 12, 2025
@rust-bors
Copy link

rust-bors bot commented Jul 12, 2025

☀️ Try build successful (CI)
Build commit: 8494e68 (8494e6881d8ac4d5f15e3ed5b25fc7c1cac5a7f8, parent: bfc046a4b8d6b57db02540182466e989a9b0fb40)

@rust-timer
Copy link
Collaborator

Queued 8494e68 with parent bfc046a, future comparison URL.
There are currently 3 preceding artifacts in the queue.
It will probably take at least ~3.9 hours until the benchmark run finishes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-perf Status: Waiting on a perf run to be completed. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants