diff options
author | Michał Muskała <[email protected]> | 2017-08-09 13:51:16 +0200 |
---|---|---|
committer | Michał Muskała <[email protected]> | 2017-08-13 19:30:38 +0200 |
commit | f7c9383f4c3d4b6819b5ba4d54c7093df806fe4a (patch) | |
tree | 3148d13aa2b699cdbecb64aafbe236b40f19ab08 /scripts | |
parent | 63528ed4fa6463097dffdc951b46321bac37350f (diff) | |
download | otp-f7c9383f4c3d4b6819b5ba4d54c7093df806fe4a.tar.gz otp-f7c9383f4c3d4b6819b5ba4d54c7093df806fe4a.tar.bz2 otp-f7c9383f4c3d4b6819b5ba4d54c7093df806fe4a.zip |
Run the sharing optimisation in beam_jump until fixpoint
This is especially useful after inlining a function with a case.
Today the compiler would most probably be able to unify all the leafs of the
case during the sharing optimisation, but it would fail to unify the pattern
matching itself.
Naively running the optimisation multiple times wouldn't be able to find the
common code either, because it would differ in jump/fail targets of various
instructions.
To remedy this, after doing each sharing pass we traverse the code backwards
when reversing and update all the jump targets with the new targets that were
discovered during the unification pass. This allows running the optimisation
until fixpoint and makes sure all sharing opportunities will be discovered.
This optimisation also helps with the Elixir's `with/else` construct.
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions