aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/beam_utils.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-04-18 10:22:29 +0200
committerBjörn Gustavsson <[email protected]>2016-04-18 10:22:29 +0200
commit1f365d733604afd27e48afff80071cf2c67e1091 (patch)
tree62163cea4dcef7cd97074493a1fc867c495390b9 /lib/compiler/src/beam_utils.erl
parent3a0aa160f5f13857d7335c3f3524bd0a59250cc4 (diff)
parentc74f998b9ad46785aaa2557a4033c056574dc937 (diff)
downloadotp-1f365d733604afd27e48afff80071cf2c67e1091.tar.gz
otp-1f365d733604afd27e48afff80071cf2c67e1091.tar.bz2
otp-1f365d733604afd27e48afff80071cf2c67e1091.zip
Merge branch 'bjorn/compiler/misc-opt'
* bjorn/compiler/misc-opt: v3_kernel: Construct literal lists properly Use the register map in %live in beam_utils:is_killed_block/2 Teach beam_utils to check liveness for put_map instructions beam_peep: Help out beam_jump
Diffstat (limited to 'lib/compiler/src/beam_utils.erl')
-rw-r--r--lib/compiler/src/beam_utils.erl15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/compiler/src/beam_utils.erl b/lib/compiler/src/beam_utils.erl
index b338286a16..37f89dd677 100644
--- a/lib/compiler/src/beam_utils.erl
+++ b/lib/compiler/src/beam_utils.erl
@@ -484,6 +484,17 @@ check_liveness(R, [{get_map_elements,{f,Fail},S,{list,L}}|Is], St0) ->
Other
end
end;
+check_liveness(R, [{put_map,{f,_},_,Src,_D,Live,{list,_}}|_], St0) ->
+ case R of
+ Src ->
+ {used,St0};
+ {x,X} when X < Live ->
+ {used,St0};
+ {x,_} ->
+ {killed,St0};
+ {y,_} ->
+ {unknown,St0}
+ end;
check_liveness(R, [{test_heap,N,Live}|Is], St) ->
I = {block,[{set,[],[],{alloc,Live,{nozero,nostack,N,[]}}}]},
check_liveness(R, [I|Is], St);
@@ -570,9 +581,9 @@ check_killed_block(R, [{set,Ds,Ss,_Op}|Is]) ->
false -> check_killed_block(R, Is)
end
end;
-check_killed_block(R, [{'%live',Live,_}|Is]) ->
+check_killed_block(R, [{'%live',_,Regs}|Is]) ->
case R of
- {x,X} when X >= Live -> killed;
+ {x,X} when (Regs bsr X) band 1 =:= 0 -> killed;
_ -> check_killed_block(R, Is)
end;
check_killed_block(_, []) -> transparent.