diff options
author | Björn Gustavsson <[email protected]> | 2017-11-29 07:02:17 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2017-11-29 07:23:57 +0100 |
commit | 63a4f821b067b19e249a0bec31295c568e2a89b5 (patch) | |
tree | 121e22d736a81bd553ae2e5aa93d199c1827a6fb /lib | |
parent | 1e5649c8494e90031c878ee540c7ef6d9bf37ffa (diff) | |
download | otp-63a4f821b067b19e249a0bec31295c568e2a89b5.tar.gz otp-63a4f821b067b19e249a0bec31295c568e2a89b5.tar.bz2 otp-63a4f821b067b19e249a0bec31295c568e2a89b5.zip |
v3_codegen: Remove check of operand for bs_context_to_binary
The bs_context_to_binary instruction only allows a register operand.
v3_codegen has a test to ensure that the operand is a register.
That test is no longer necessary. There used to be a possibility
that optimizations in sys_core_fold and the inliner could change
the operand for bs_context_to_binary to a binary literal. Since
09112806c15a81b that can no longer happen, because no more
optimizations are run after the introduction of the
bs_context_to_binary instruction.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/compiler/src/v3_codegen.erl | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/lib/compiler/src/v3_codegen.erl b/lib/compiler/src/v3_codegen.erl index 006a6a82d2..535c0679d8 100644 --- a/lib/compiler/src/v3_codegen.erl +++ b/lib/compiler/src/v3_codegen.erl @@ -1634,12 +1634,7 @@ bif_cg(#k_bif{op=#k_remote{mod=#k_atom{val=erlang},name=#k_atom{val=Name}}, internal_cg(bs_context_to_binary=Instr, [Src0], [], Le, Vdb, Bef, St0) -> [Src] = cg_reg_args([Src0], Bef), - case is_register(Src) of - false -> - {[],clear_dead(Bef, Le#l.i, Vdb), St0}; - true -> - {[{Instr,Src}],clear_dead(Bef, Le#l.i, Vdb), St0} - end; + {[{Instr,Src}],clear_dead(Bef, Le#l.i, Vdb), St0}; internal_cg(dsetelement, [Index0,Tuple0,New0], _Rs, Le, Vdb, Bef, St0) -> [New,Tuple,{integer,Index1}] = cg_reg_args([New0,Tuple0,Index0], Bef), Index = Index1-1, @@ -2571,10 +2566,6 @@ find_stack(_, [], _) -> error. on_stack(V, Stk) -> keymember(V, 1, Stk). -is_register({x,_}) -> true; -is_register({yy,_}) -> true; -is_register(_) -> false. - %% put_catch(CatchTag, Stack) -> Stack' %% drop_catch(CatchTag, Stack) -> Stack' %% Special interface for putting and removing catch tags, to ensure that |