ocaml-flambda / flambda-backend

The Flambda backend project for OCaml
Other
112 stars 77 forks source link

Sharing of switch arms #1792

Open xclerc opened 1 year ago

xclerc commented 1 year ago

Not a lot of details at this point, but we are seeing cases whether an flambda2 fragment like the following one:

switch ...
| 0 ↦ apply_cont k111
| 1 | ... dozens of cases ... | 111 ↦ apply_cont k222
| 99 ↦ apply_cont k333

ends up producing assembly code where the code related to k222 is being duplicated.

Gbury commented 1 year ago

That's interesting, do you have any further information ?