Skip to content

Simplify CfgBuilder to place all targets of br_table as outgoing edges of the same block - #703

Merged
titzer merged 3 commits into
titzer:masterfrom
matthew-mojira:fix_br_table_cfg
Sep 24, 2026
Merged

titzer merged 3 commits into
titzer:masterfrom
matthew-mojira:fix_br_table_cfg

Conversation

@matthew-mojira

@matthew-mojira matthew-mojira commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Right now the CFG Builder iterates over each target label and treats it as a chain of br_if instructions. This bloats the CFG as each label in a br_table instruction gets its own block (whose outgoing edges are the target if that branch is taken and a fallthrough to the test on the next index). (Blocks with no instructions are very annoying on the Ball-Larus path profiler since I need an instruction associated with each edge to place a probe on.) This change makes it so that a basic block ending in a br_table has all its outgoing edges from the same block.

@titzer

titzer commented Sep 24, 2026

Copy link
Copy Markdown
Owner

You'll need to push an empty change to this to force CI to run again with the fixes to CI on master.

@titzer
titzer merged commit 0d60232 into titzer:master Sep 24, 2026
14 checks passed
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