Skip to content

Use preorder traversal when checking for SSA locals #85741

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 1 commit into from
Jun 10, 2021
Merged

Conversation

tmiasko
Copy link
Contributor

@tmiasko tmiasko commented May 27, 2021

Traverse blocks in topological sort of dominance partial order, to ensure that
local analyzer correctly identifies locals that are already in static single
assignment form, while avoiding dependency on implicit numeric order of blocks.

When rebuilding the standard library, this change reduces the number of locals
that require an alloca from 62452 to 62348.

@rust-highfive
Copy link
Contributor

r? @davidtwco

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 27, 2021
@tmiasko
Copy link
Contributor Author

tmiasko commented May 27, 2021

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

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

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label May 27, 2021
@bors
Copy link
Collaborator

bors commented May 27, 2021

⌛ Trying commit d321c04b7ba590e2129c0d2414c4749f92694ee5 with merge 4efccbc84ee38e5ba31393f12563d831ad3fa9ac...

@bors
Copy link
Collaborator

bors commented May 27, 2021

☀️ Try build successful - checks-actions
Build commit: 4efccbc84ee38e5ba31393f12563d831ad3fa9ac (4efccbc84ee38e5ba31393f12563d831ad3fa9ac)

@rust-timer
Copy link
Collaborator

Queued 4efccbc84ee38e5ba31393f12563d831ad3fa9ac with parent 9814e83, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking try commit (4efccbc84ee38e5ba31393f12563d831ad3fa9ac): comparison url.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying rollup- to bors.

Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up.

@bors rollup=never
@rustbot label: +S-waiting-on-review -S-waiting-on-perf

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label May 27, 2021
@tmiasko
Copy link
Contributor Author

tmiasko commented May 28, 2021

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

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

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label May 28, 2021
@bors
Copy link
Collaborator

bors commented May 28, 2021

⌛ Trying commit f3dd15dc8d8b5e19e6cf69cf3b0b4f78cde37aeb with merge fa6f2a233a21a3945e64b20d72b08739cf830e04...

@bors
Copy link
Collaborator

bors commented May 28, 2021

☀️ Try build successful - checks-actions
Build commit: fa6f2a233a21a3945e64b20d72b08739cf830e04 (fa6f2a233a21a3945e64b20d72b08739cf830e04)

@rust-timer
Copy link
Collaborator

Queued fa6f2a233a21a3945e64b20d72b08739cf830e04 with parent ce0d64e, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking try commit (fa6f2a233a21a3945e64b20d72b08739cf830e04): comparison url.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying rollup- to bors.

Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up.

@bors rollup=never
@rustbot label: +S-waiting-on-review -S-waiting-on-perf

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label May 28, 2021
@nagisa
Copy link
Member

nagisa commented May 30, 2021

So it does seem that not reusing the post-order calculation is a 0.2-0.3% instruction count reduction. Which does seem quite significant. I suspect there's likely also some cost in LLVM itself from it trying to produce better machine code in debug builds, which the change to reuse the post-order iterator likely counteracted.

@tmiasko
Copy link
Contributor Author

tmiasko commented May 30, 2021

We can also use somewhat cheaper traversal.

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

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

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label May 30, 2021
@bors
Copy link
Collaborator

bors commented May 30, 2021

⌛ Trying commit e3814fd7c64486dfff70935b358e6538eb9698ab with merge 4e646d2a8538dfe57c622be92b6884e6d9eb677c...

@nagisa
Copy link
Member

nagisa commented Jun 9, 2021

@bors r+ delegate=tmiasko

@bors
Copy link
Collaborator

bors commented Jun 9, 2021

📌 Commit 4237a05 has been approved by nagisa

@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 Jun 9, 2021
@bors
Copy link
Collaborator

bors commented Jun 9, 2021

✌️ @tmiasko can now approve this pull request

@bjorn3
Copy link
Member

bjorn3 commented Jun 9, 2021

@nagisa did you intend to both approve and delegate at the same time?

@nagisa
Copy link
Member

nagisa commented Jun 9, 2021

Yes, so that in case there's a need to rebase again, @tmiasko can r=me it themselves. I mildly remember them saying they do not have bors-rights yet.

@bjorn3
Copy link
Member

bjorn3 commented Jun 9, 2021

I see.

@bors
Copy link
Collaborator

bors commented Jun 9, 2021

⌛ Testing commit 4237a05 with merge b9634bcbc1755480469605fd59b81c6ec34276cb...

@bors
Copy link
Collaborator

bors commented Jun 9, 2021

💥 Test timed out

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 9, 2021
@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@tmiasko
Copy link
Contributor Author

tmiasko commented Jun 10, 2021

dist-powerpc64le-linux hanged while "Updating crates.io index".

@bors retry

@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 Jun 10, 2021
@bors
Copy link
Collaborator

bors commented Jun 10, 2021

⌛ Testing commit 4237a05 with merge 3672dcda95dc42c3b46df09307a0fd2460ed9a9f...

@pietroalbini
Copy link
Member

Need to do maintenance on the CI (Zulip log), closing the tree. Also, this PR seems stuck on the armhf-gnu builder, and will timeout soon anyway, so cancelling it.

@bors treeclosed=1000 retry

@pietroalbini
Copy link
Member

@bors treeclosed-

@bors
Copy link
Collaborator

bors commented Jun 10, 2021

⌛ Testing commit 4237a05 with merge 0279cb1...

@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@bors
Copy link
Collaborator

bors commented Jun 10, 2021

☀️ Test successful - checks-actions
Approved by: nagisa
Pushing 0279cb1 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 10, 2021
@bors bors merged commit 0279cb1 into rust-lang:master Jun 10, 2021
@rustbot rustbot added this to the 1.54.0 milestone Jun 10, 2021
@tmiasko tmiasko deleted the ssa branch June 10, 2021 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants