Skip to content

Conversation

@fitzgen
Copy link
Member

@fitzgen fitzgen commented Jul 18, 2025

We copy all callee blocks into the caller's layout, but were then only copying the callee instructions in reachable callee blocks into the caller. Therefore, any unreachable blocks would remain empty in the caller, which is invalid CLIF because all blocks must end in a terminator, so this commit adds a quick pass over the inlined blocks to remove any empty blocks from the caller's layout.

We copy *all* callee blocks into the caller's layout, but were then only copying
the callee instructions in *reachable* callee blocks into the caller. Therefore,
any *unreachable* blocks would remain empty in the caller, which is invalid CLIF
because all blocks must end in a terminator, so this commit adds a quick pass
over the inlined blocks to remove any empty blocks from the caller's layout.
@fitzgen fitzgen requested a review from a team as a code owner July 18, 2025 22:55
@fitzgen fitzgen requested review from alexcrichton and removed request for a team July 18, 2025 22:55
@github-actions github-actions bot added the cranelift Issues related to the Cranelift code generator label Jul 19, 2025
@cfallin cfallin added this pull request to the merge queue Jul 22, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 22, 2025
@alexcrichton alexcrichton added this pull request to the merge queue Jul 22, 2025
Merged via the queue into bytecodealliance:main with commit e3a607e Jul 22, 2025
42 checks passed
@fitzgen fitzgen deleted the inlining-unreachable-blocks branch July 22, 2025 22:29
bongjunj pushed a commit to prosyslab/wasmtime that referenced this pull request Oct 20, 2025
…ecodealliance#11282)

We copy *all* callee blocks into the caller's layout, but were then only copying
the callee instructions in *reachable* callee blocks into the caller. Therefore,
any *unreachable* blocks would remain empty in the caller, which is invalid CLIF
because all blocks must end in a terminator, so this commit adds a quick pass
over the inlined blocks to remove any empty blocks from the caller's layout.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cranelift Issues related to the Cranelift code generator

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants