diff options
author | Björn Gustavsson <[email protected]> | 2018-08-21 08:58:15 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2018-09-17 06:41:02 +0200 |
commit | 70bb14fe3fd27e8c429bf402e364b144a5807d9a (patch) | |
tree | c8c86337d5324e900ce483eb49b32227a3a314d2 /lib/compiler/src/compile.erl | |
parent | ec1f35c9f52be894ba295b9a48237020855e3c46 (diff) | |
download | otp-70bb14fe3fd27e8c429bf402e364b144a5807d9a.tar.gz otp-70bb14fe3fd27e8c429bf402e364b144a5807d9a.tar.bz2 otp-70bb14fe3fd27e8c429bf402e364b144a5807d9a.zip |
Add beam_ssa_dead.erl
Add beam_ssa_dead to perform the main optimizations done
by beam_dead:
* Shortcut branches that jump to another block with a branch.
If it can be seen that the second branch will always branch
to a specific block, replace the target of the first branch.
* Combined nested sequences of '=:=' tests and switch
instructions operating on the same variable to a single switch.
Diffing the compiler output, it seems that beam_ssa_dead finds
many more opportunities for optimizations than beam_dead,
although it does not find all opportunities that beam_dead does.
In total, beam_ssa_dead is such improvement over beam_dead that
there is no reason to keep beam_dead as well as beam_ssa_dead.
Note that beam_ssa_dead does not attempt to optimize away
redundant bs_context_binary instructions, because that instruction
will be superseded by new instructions in the near future.
Diffstat (limited to 'lib/compiler/src/compile.erl')
-rw-r--r-- | lib/compiler/src/compile.erl | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/compiler/src/compile.erl b/lib/compiler/src/compile.erl index 0a7f723c64..a0ebfff5f7 100644 --- a/lib/compiler/src/compile.erl +++ b/lib/compiler/src/compile.erl @@ -2047,6 +2047,7 @@ pre_load() -> beam_peep, beam_ssa, beam_ssa_codegen, + beam_ssa_dead, beam_ssa_opt, beam_ssa_pre_codegen, beam_ssa_recv, |