aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/beam_ssa_opt.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2019-01-16 19:06:19 +0100
committerBjörn Gustavsson <[email protected]>2019-01-17 13:40:02 +0100
commit9c852215c79ed6ec42c223463d4b5a0c221b4bf0 (patch)
treed597366a655184d3958661b7206b5a6d6ff54199 /lib/compiler/src/beam_ssa_opt.erl
parent9627785145f4db991ce0206d2fdc053557720c61 (diff)
downloadotp-9c852215c79ed6ec42c223463d4b5a0c221b4bf0.tar.gz
otp-9c852215c79ed6ec42c223463d4b5a0c221b4bf0.tar.bz2
otp-9c852215c79ed6ec42c223463d4b5a0c221b4bf0.zip
beam_ssa_type: Eliminate redundant 'succeeded' instructions
The beam_ssa_type pass would leave redundant 'succeeded' instructions, and depend on the live optimization pass to remove them. Update beam_ssa_type to remove redundant 'succeeded' instructions. This will not improve the generated code, but will improve compilation times since it eliminates instructions and variables.
Diffstat (limited to 'lib/compiler/src/beam_ssa_opt.erl')
-rw-r--r--lib/compiler/src/beam_ssa_opt.erl11
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/compiler/src/beam_ssa_opt.erl b/lib/compiler/src/beam_ssa_opt.erl
index 6bba47b4ac..e23e62b5ad 100644
--- a/lib/compiler/src/beam_ssa_opt.erl
+++ b/lib/compiler/src/beam_ssa_opt.erl
@@ -856,14 +856,9 @@ live_opt_is([#b_set{op=succeeded,dst=SuccDst=SuccDstVar,
#b_set{dst=Dst}=I|Is], Live0, Acc) ->
case gb_sets:is_member(Dst, Live0) of
true ->
- case gb_sets:is_member(SuccDst, Live0) of
- true ->
- Live1 = gb_sets:add(Dst, Live0),
- Live = gb_sets:delete_any(SuccDst, Live1),
- live_opt_is([I|Is], Live, [SuccI|Acc]);
- false ->
- live_opt_is([I|Is], Live0, Acc)
- end;
+ Live1 = gb_sets:add(Dst, Live0),
+ Live = gb_sets:delete_any(SuccDst, Live1),
+ live_opt_is([I|Is], Live, [SuccI|Acc]);
false ->
case live_opt_unused(I) of
{replace,NewI0} ->