Skip to content

Flatten/LowerBrOn experiment#8569

Draft
kripken wants to merge 25 commits intoWebAssembly:mainfrom
kripken:flat.moar
Draft

Flatten/LowerBrOn experiment#8569
kripken wants to merge 25 commits intoWebAssembly:mainfrom
kripken:flat.moar

Conversation

@kripken
Copy link
Copy Markdown
Member

@kripken kripken commented Apr 2, 2026

This patch lowers BrOn* into Br in Flatten, allowing it to flatten GC code. I
then tested to see if Flatten+ReReloop end up helping, which in theory they
could have since

  1. Flatten un-nests code which lets some optimizations work better
    (fewer nested effects).
  2. ReReloop requires Flatten, and it can reshape control flow more optimally.

However, I don't see a benefit. The benefits we saw on non-GC code, that
is LLVM output, may have been tied to LLVM. In particular LLVM doesn't
emit Ifs, but GC compilers do. (I tested on Kotlin and Java.)

This is not worth landing but I wanted to post it, as evidence that we don't
need to work on Flatten currently. Maybe we can even consider removing it
entirely.

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.

1 participant