diff options
author | Björn Gustavsson <[email protected]> | 2012-09-04 12:40:26 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2012-10-09 15:24:41 +0200 |
commit | 105e056cddaf765952d58813e2ec5c9bdfd4403c (patch) | |
tree | 240f4942ec4360336272d495009c498380e4b3be /lib/compiler/src/compile.erl | |
parent | 8c9863948b440f2741b6df3ffda2c6dd2b7b363c (diff) | |
download | otp-105e056cddaf765952d58813e2ec5c9bdfd4403c.tar.gz otp-105e056cddaf765952d58813e2ec5c9bdfd4403c.tar.bz2 otp-105e056cddaf765952d58813e2ec5c9bdfd4403c.zip |
Refactor removal of unused labels
Since we always want to remove unused labels directly after code
generation (whether we'll run the optimization passes or not),
we can simplify the code by doing it in beam_a.
Diffstat (limited to 'lib/compiler/src/compile.erl')
-rw-r--r-- | lib/compiler/src/compile.erl | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/compiler/src/compile.erl b/lib/compiler/src/compile.erl index 0346c0441a..df1af36eeb 100644 --- a/lib/compiler/src/compile.erl +++ b/lib/compiler/src/compile.erl @@ -660,12 +660,9 @@ asm_passes() -> {iff,dtrim,{listing,"trim"}}, {pass,beam_flatten}]}, - %% If post optimizations are turned off, we still coalesce - %% adjacent labels and remove unused labels to keep the - %% HiPE compiler happy. - {iff,no_postopt, - [?pass(beam_unused_labels), - {pass,beam_clean}]}, + %% If post optimizations are turned off, we still + %% need to do a few clean-ups to code. + {iff,no_postopt,[{pass,beam_clean}]}, {pass,beam_z}, {iff,dopt,{listing,"optimize"}}, @@ -1244,10 +1241,6 @@ random_bytes_1(N, Acc) -> random_bytes_1(N-1, [random:uniform(255)|Acc]). save_core_code(St) -> {ok,St#compile{core_code=cerl:from_records(St#compile.code)}}. -beam_unused_labels(#compile{code=Code0}=St) -> - Code = beam_jump:module_labels(Code0), - {ok,St#compile{code=Code}}. - beam_asm(#compile{ifile=File,code=Code0, abstract_code=Abst,mod_options=Opts0}=St) -> Source = filename:absname(File), |