diff options
author | Sverker Eriksson <[email protected]> | 2016-08-12 17:41:38 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2016-08-12 17:41:38 +0200 |
commit | 650d0d075dfddf1bc3ebfa2cb9357d8311fd9645 (patch) | |
tree | d8b19d650a56706b25ac4c8589490e5d500d250a /lib/hipe/x86/hipe_x86_frame.erl | |
parent | 74357d43f887c93bc2f567d044cf2027585ecf46 (diff) | |
parent | fd97ddb2c3031140f12c98c93a31325b15ea8cb6 (diff) | |
download | otp-650d0d075dfddf1bc3ebfa2cb9357d8311fd9645.tar.gz otp-650d0d075dfddf1bc3ebfa2cb9357d8311fd9645.tar.bz2 otp-650d0d075dfddf1bc3ebfa2cb9357d8311fd9645.zip |
Merge branch 'sverker/hipe-performance-algorithms/PR-1124/OTP-13810'
Diffstat (limited to 'lib/hipe/x86/hipe_x86_frame.erl')
-rw-r--r-- | lib/hipe/x86/hipe_x86_frame.erl | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/lib/hipe/x86/hipe_x86_frame.erl b/lib/hipe/x86/hipe_x86_frame.erl index 8851ead250..4cdc04007d 100644 --- a/lib/hipe/x86/hipe_x86_frame.erl +++ b/lib/hipe/x86/hipe_x86_frame.erl @@ -622,26 +622,31 @@ find_temps([I|Insns], S0) -> find_temps([], S) -> S. +-compile({inline, [tset_empty/0, tset_size/1, tset_insert/2, + tset_filter/2, tset_to_list/1]}). + tset_empty() -> - gb_sets:new(). + #{}. tset_size(S) -> - gb_sets:size(S). + map_size(S). tset_insert(S, T) -> - gb_sets:add_element(T, S). + S#{T => []}. -tset_add_list(S, Ts) -> - gb_sets:union(S, gb_sets:from_list(Ts)). +tset_add_list(S, []) -> S; +tset_add_list(S, [T|Ts]) -> + tset_add_list(S#{T => []}, Ts). -tset_del_list(S, Ts) -> - gb_sets:subtract(S, gb_sets:from_list(Ts)). +tset_del_list(S, []) -> S; +tset_del_list(S, [T|Ts]) -> + tset_del_list(maps:remove(T,S), Ts). tset_filter(S, F) -> - gb_sets:filter(F, S). + maps:filter(fun(K, _V) -> F(K) end, S). tset_to_list(S) -> - gb_sets:to_list(S). + maps:keys(S). %%% %%% Compute minimum permissible frame size, ignoring spilled temps. |