aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe/main/hipe_main.erl
diff options
context:
space:
mode:
authorMagnus Lång <[email protected]>2014-04-14 18:10:31 +0200
committerMagnus Lång <[email protected]>2016-05-23 17:09:27 +0200
commitb9068c94921e97cc918e9c8664c252af33bfaf39 (patch)
treecccab675404610b623ac5215c0cb59933b49b00a /lib/hipe/main/hipe_main.erl
parenta152a8a4e6df5fca0ca6fb0a62ac8fea41b99571 (diff)
downloadotp-b9068c94921e97cc918e9c8664c252af33bfaf39.tar.gz
otp-b9068c94921e97cc918e9c8664c252af33bfaf39.tar.bz2
otp-b9068c94921e97cc918e9c8664c252af33bfaf39.zip
Added elimination of maps:is_key/2 calls to HiPE
* Implemented removal of maps:is_key/2 calls of which the result is known in a new pass during the typed phase, called hipe_icode_call_elim. * Added the option icode_call_elim that enables the hipe_icode_call_elim pass, and made it default for o2.
Diffstat (limited to 'lib/hipe/main/hipe_main.erl')
-rw-r--r--lib/hipe/main/hipe_main.erl14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/hipe/main/hipe_main.erl b/lib/hipe/main/hipe_main.erl
index be5050e155..b9d783d20a 100644
--- a/lib/hipe/main/hipe_main.erl
+++ b/lib/hipe/main/hipe_main.erl
@@ -284,8 +284,9 @@ icode_ssa_type(IcodeSSA, MFA, Options, Servers) ->
false -> AnnIcode1
end,
AnnIcode3 = icode_range_analysis(AnnIcode2, MFA, Options, Servers),
- pp(AnnIcode3, MFA, icode, pp_range_icode, Options, Servers),
- hipe_icode_type:unannotate_cfg(AnnIcode3)
+ AnnIcode4 = icode_eliminate_safe_calls(AnnIcode3, Options),
+ pp(AnnIcode4, MFA, icode, pp_range_icode, Options, Servers),
+ hipe_icode_type:unannotate_cfg(AnnIcode4)
end.
icode_ssa_convert(IcodeCfg, Options) ->
@@ -334,6 +335,15 @@ icode_range_analysis(IcodeSSA, MFA, Options, Servers) ->
IcodeSSA
end.
+icode_eliminate_safe_calls(IcodeSSA, Options) ->
+ case proplists:get_bool(icode_call_elim, Options) of
+ true ->
+ ?option_time(hipe_icode_call_elim:cfg(IcodeSSA),
+ "Icode SSA safe call elimination", Options);
+ false ->
+ IcodeSSA
+ end.
+
icode_ssa_dead_code_elimination(IcodeSSA, Options) ->
IcodeSSA1 = ?option_time(hipe_icode_ssa:remove_dead_code(IcodeSSA),
"Icode SSA dead code elimination pass 2",