diff options
author | Björn-Egil Dahlberg <[email protected]> | 2016-05-26 14:17:04 +0200 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2016-05-26 14:17:04 +0200 |
commit | 4d7b24dcb8f10ea8ddaa002601916fb389f0e87e (patch) | |
tree | fe7e75608465adbffd81e22ad7943b567a3caab4 /lib/hipe/main/hipe_main.erl | |
parent | 1081e3881e3994f381d122600d5db129c0ad0266 (diff) | |
parent | f833a900897faae48230bc8c1e7572fb470a4a6f (diff) | |
download | otp-4d7b24dcb8f10ea8ddaa002601916fb389f0e87e.tar.gz otp-4d7b24dcb8f10ea8ddaa002601916fb389f0e87e.tar.bz2 otp-4d7b24dcb8f10ea8ddaa002601916fb389f0e87e.zip |
Merge branch 'margnus1/hipe/maps-is_key-opts/PR-1069/OTP-13625'
* margnus1/hipe/maps-is_key-opts/PR-1069/OTP-13625:
hipe: Add test suite for verifying optimisations
Added elimination of maps:is_key/2 calls to HiPE
Diffstat (limited to 'lib/hipe/main/hipe_main.erl')
-rw-r--r-- | lib/hipe/main/hipe_main.erl | 14 |
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", |