aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2019-01-22 06:33:56 +0100
committerBjörn Gustavsson <[email protected]>2019-01-23 10:47:29 +0100
commit2dc8ec94208e53828a2dd9d084a7b58f224b81fa (patch)
treecab876b1d17a4c86bc6e7d0334de8b9f2cb0bf47 /lib
parent1d2d2aef118db24e478a57a73e1dcd15e699a29a (diff)
downloadotp-2dc8ec94208e53828a2dd9d084a7b58f224b81fa.tar.gz
otp-2dc8ec94208e53828a2dd9d084a7b58f224b81fa.tar.bz2
otp-2dc8ec94208e53828a2dd9d084a7b58f224b81fa.zip
beam_ssa_pre_codegen: Use lists:splitwith/2 for separating phi nodes
Use lists:splitwith/2 instead of lists:partition/2 for splitting out phi nodes. Since phi nodes are always the first instructions in a block, the result will be the same, but splitwith/2 is faster.
Diffstat (limited to 'lib')
-rw-r--r--lib/compiler/src/beam_ssa_pre_codegen.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/compiler/src/beam_ssa_pre_codegen.erl b/lib/compiler/src/beam_ssa_pre_codegen.erl
index fa1b7bb71e..39b778f174 100644
--- a/lib/compiler/src/beam_ssa_pre_codegen.erl
+++ b/lib/compiler/src/beam_ssa_pre_codegen.erl
@@ -72,7 +72,7 @@
-import(lists, [all/2,any/2,append/1,duplicate/2,
foldl/3,last/1,map/2,member/2,partition/2,
- reverse/1,reverse/2,sort/1,zip/2]).
+ reverse/1,reverse/2,sort/1,splitwith/2,zip/2]).
-spec module(beam_ssa:b_module(), [compile:option()]) ->
{'ok',beam_ssa:b_module()}.
@@ -2496,7 +2496,7 @@ rel2fam(S0) ->
sofs:to_external(S).
split_phis(Is) ->
- partition(fun(#b_set{op=Op}) -> Op =:= phi end, Is).
+ splitwith(fun(#b_set{op=Op}) -> Op =:= phi end, Is).
is_yreg({y,_}) -> true;
is_yreg({x,_}) -> false;