Skip to content

Analysis cleanups - #161203

Open
nnethercote wants to merge 3 commits into
rust-lang:mainfrom
nnethercote:Analysis-cleanups
Open

Analysis cleanups#161203
nnethercote wants to merge 3 commits into
rust-lang:mainfrom
nnethercote:Analysis-cleanups

Conversation

@nnethercote

Copy link
Copy Markdown
Contributor

Three small dataflow analysis cleanups. Details in individual commits.

r? @cjgillot

For `Call` and `InlineAsm` we currently pass `pred` to
`apply_call_return_effect`, but for `Yield` we pass `block`. This
appears to be a copy/paste error. This currently has no effect because
no existing backward analyses look at this argument, but it's worth
fixing.

There's also a similar case in graphviz.rs.
The edge computation for `Call`, `InlineAsm`, and `Yield` exactly
duplicates what is done by `TerminatorKind::edges()`. This commit
changes it to use `edges()`; this makes the backward analysis more
similar to the forward analysis, which also matches on
`TerminatorEdges`.

Note: the bug fixed in the previous commit would have been less likely
with this new code.
@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 Aug 16, 2026
@nnethercote

Copy link
Copy Markdown
Contributor Author

LLM disclosure: an LLM found these when directed to look for simplifications. I wrote all the code and text changes myself.

@cjgillot

Copy link
Copy Markdown
Contributor

@bors r+

@rust-bors

rust-bors Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

📌 Commit ea4322d has been approved by cjgillot

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Aug 17, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Aug 17, 2026
…jgillot

Analysis cleanups

Three small dataflow analysis cleanups. Details in individual commits.

r? @cjgillot
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.

3 participants