diff options
author | Björn Gustavsson <[email protected]> | 2018-09-05 13:25:28 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2018-09-05 13:25:28 +0200 |
commit | 66b797b4aeca486f515d96c1677cc633ce12a5d3 (patch) | |
tree | 1d5d55a26a42a97b1f052fa87cfe772e212b6775 /lib/compiler/src/beam_ssa_codegen.erl | |
parent | 092f4847f489cba0381676a6a389ddbfc2af4f1e (diff) | |
parent | 47a2ff39ac75c69b41f90f05a63fd9a2e6c0b36a (diff) | |
download | otp-66b797b4aeca486f515d96c1677cc633ce12a5d3.tar.gz otp-66b797b4aeca486f515d96c1677cc633ce12a5d3.tar.bz2 otp-66b797b4aeca486f515d96c1677cc633ce12a5d3.zip |
Merge pull request #1947 from bjorng/bjorn/opt-put-tuple
Introduce a put_tuple2 instruction
Diffstat (limited to 'lib/compiler/src/beam_ssa_codegen.erl')
-rw-r--r-- | lib/compiler/src/beam_ssa_codegen.erl | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/compiler/src/beam_ssa_codegen.erl b/lib/compiler/src/beam_ssa_codegen.erl index 357352269c..006c41c0e0 100644 --- a/lib/compiler/src/beam_ssa_codegen.erl +++ b/lib/compiler/src/beam_ssa_codegen.erl @@ -286,6 +286,8 @@ classify_heap_need(put_list, _) -> {put,2}; classify_heap_need(put_tuple_arity, [#b_literal{val=Words}]) -> {put,Words+1}; +classify_heap_need(put_tuple, Elements) -> + {put,length(Elements)+1}; classify_heap_need({bif,Name}, Args) -> case is_gc_bif(Name, Args) of false -> neutral; @@ -1360,6 +1362,8 @@ cg_instr(get_tuple_element=Op, [Src,{integer,N}], Dst) -> [{Op,Src,N,Dst}]; cg_instr(put_list=Op, [Hd,Tl], Dst) -> [{Op,Hd,Tl,Dst}]; +cg_instr(put_tuple, Elements, Dst) -> + [{put_tuple2,Dst,{list,Elements}}]; cg_instr(put_tuple_arity, [{integer,Arity}], Dst) -> [{put_tuple,Arity,Dst}]; cg_instr(put_tuple_elements, Elements, _Dst) -> |