Skip to content

[NFC] Use RPOQueue in liveness-traversal - #9152

Merged
kripken merged 10 commits into
WebAssembly:mainfrom
kripken:rpo.2
Sep 24, 2026
Merged

kripken merged 10 commits into
WebAssembly:mainfrom
kripken:rpo.2

Conversation

@kripken

@kripken kripken commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

This makes CoalesceLocals 15% faster, for similar reasons as #9149.

Helps #4165

@kripken
kripken requested a review from a team as a code owner September 24, 2026 16:00
@kripken
kripken requested review from tlively and removed request for a team September 24, 2026 16:00
Comment thread src/cfg/rpo.h
// By processing blocks with higher RPO indexes first, we process successors
// before predecessors, and fully process loops and diamonds before flowing data
// backwards to earlier blocks in the CFG.
template<typename CFG> using POQueue = RPOQueue<CFG, std::less<Index>>;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I can't not read this as "program-order queue," which is exactly wrong 😢

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We could write this out as PostOrderQueue, though ReversePostOrderQueue is clunky...

Another option is RRPOQueue 😉

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yeah, it's ok as-is. I'll just have to deal with it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ok, landing for now, but I'm happy to rename later to PostOrderQueue if you find this annoying.

@kripken
kripken merged commit 2dc30e2 into WebAssembly:main Sep 24, 2026
16 checks passed
@kripken
kripken deleted the rpo.2 branch September 24, 2026 17:10
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 this pull request may close these issues.

2 participants