aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/compile.erl
diff options
context:
space:
mode:
authorJohn Högberg <[email protected]>2018-10-01 15:23:17 +0200
committerJohn Högberg <[email protected]>2018-10-03 13:42:10 +0200
commit31a4c1d65c24d8240d5d46d8cffe81097ebb28bf (patch)
tree39f2593781ab8d9029fe161b0da6bdad5943bdbd /lib/compiler/src/compile.erl
parent25d15bc981659947899499bbce6040868d73418f (diff)
downloadotp-31a4c1d65c24d8240d5d46d8cffe81097ebb28bf.tar.gz
otp-31a4c1d65c24d8240d5d46d8cffe81097ebb28bf.tar.bz2
otp-31a4c1d65c24d8240d5d46d8cffe81097ebb28bf.zip
Optimize named funs and fun-wrapped macros
If a fun is defined locally and only used for calls, it can be replaced with direct calls to the relevant function. This greatly speeds up "named functions" (which rely on make_fun to recreate themselves) and macros that wrap their body in a fun.
Diffstat (limited to 'lib/compiler/src/compile.erl')
-rw-r--r--lib/compiler/src/compile.erl4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/compiler/src/compile.erl b/lib/compiler/src/compile.erl
index d894694c79..b4a446e532 100644
--- a/lib/compiler/src/compile.erl
+++ b/lib/compiler/src/compile.erl
@@ -823,6 +823,9 @@ kernel_passes() ->
{unless,no_bsm_opt,{pass,beam_ssa_bsm}},
{iff,dssabsm,{listing,"ssabsm"}},
{iff,ssalint,{pass,beam_ssa_lint}},
+ {unless,no_fun_opt,{pass,beam_ssa_funs}},
+ {iff,dssafuns,{listing,"ssafuns"}},
+ {iff,ssalint,{pass,beam_ssa_lint}},
{unless,no_ssa_opt,{pass,beam_ssa_opt}},
{iff,dssaopt,{listing,"ssaopt"}},
{iff,ssalint,{pass,beam_ssa_lint}},
@@ -2047,6 +2050,7 @@ pre_load() ->
beam_ssa_bsm,
beam_ssa_codegen,
beam_ssa_dead,
+ beam_ssa_funs,
beam_ssa_opt,
beam_ssa_pre_codegen,
beam_ssa_recv,