aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2019-01-08 10:33:39 +0100
committerBjörn Gustavsson <[email protected]>2019-01-11 15:05:11 +0100
commit114ed6f86c8ab9b6a3dbaebe596934bc49e45b7a (patch)
tree69b371e6f3306379a637001dbb6c6cc1282cb3bf /lib/compiler
parent25506b84b5f3f12c85b331881fbcb3f392c49d01 (diff)
downloadotp-114ed6f86c8ab9b6a3dbaebe596934bc49e45b7a.tar.gz
otp-114ed6f86c8ab9b6a3dbaebe596934bc49e45b7a.tar.bz2
otp-114ed6f86c8ab9b6a3dbaebe596934bc49e45b7a.zip
beam_ssa_pre_codegen: Correct short-lived optimization
Diffstat (limited to 'lib/compiler')
-rw-r--r--lib/compiler/src/beam_ssa_pre_codegen.erl6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/compiler/src/beam_ssa_pre_codegen.erl b/lib/compiler/src/beam_ssa_pre_codegen.erl
index 56fe9b4793..b940c0fdc2 100644
--- a/lib/compiler/src/beam_ssa_pre_codegen.erl
+++ b/lib/compiler/src/beam_ssa_pre_codegen.erl
@@ -1996,13 +1996,13 @@ reserve_zregs(Blocks, Intervals, Res) ->
reserve_zreg([#b_set{op={bif,tuple_size},dst=Dst},
#b_set{op={bif,'=:='},args=[Dst,Val]}], Last, ShortLived, A0) ->
case {Val,Last} of
- {#b_literal{val=Arity},#b_br{}} when Arity bsr 32 =:= 0 ->
+ {#b_literal{val=Arity},#b_br{bool=#b_var{}}} when Arity bsr 32 =:= 0 ->
%% These two instructions can be combined to a test_arity
%% instruction provided that the arity variable is short-lived.
reserve_zreg_1(Dst, ShortLived, A0);
{_,_} ->
- %% Either the arity is too big, or the boolean value from
- %% '=:=' will be returned.
+ %% Either the arity is too big, or the boolean value is not
+ %% used in a conditional branch.
A0
end;
reserve_zreg([#b_set{op={bif,tuple_size},dst=Dst}],