Optimize tail calls created during optimization
Optimize tail calls created during optimization

Sometimes compiler optimizations can make body calls into tail calls.
Here is an example:

    bar() ->
        {_,_} = foo().

    foo() -> {a,b}.

Since `foo/0` returns a tuple of size two, the matching of the
tuple can be eliminated:

    bar() ->
        foo().

However, the generated code would not be optimal. For this example,
an unnecessary stack frame would be allocated. For other examples,
unnecessary `kill` or `trim` instructions would be emitted.

This commit adds an additional optimization of tail calls created by
other optimizations. For details, see the added comment in
`beam_ssa_opt`.

isvilen/otp,electricimp/otp,dumbbell/otp,erlang/otp,rlipscombe/otp,potatosalad/otp,getong/otp,ferd/otp,emacsmirror/erlang,mikpe/otp,ferd/otp,jj1bdx/otp,electricimp/otp,ferd/otp,dumbbell/otp,uabboli/otp,bjorng/otp,lrascao/otp,isvilen/otp,isvilen/otp,potatosalad/otp,uabboli/otp,bjorng/otp,erlang/otp,uabboli/otp,uabboli/otp,jj1bdx/otp,vladdu/otp,dgud/otp,jj1bdx/otp,mikpe/otp,jj1bdx/otp,g-andrade/otp,jj1bdx/otp,erlang/otp,bjorng/otp,emacsmirror/erlang,vinoski/otp,lrascao/otp,vinoski/otp,electricimp/otp,bjorng/otp,emacsmirror/erlang,lrascao/otp,vinoski/otp,g-andrade/otp,isvilen/otp,vladdu/otp,g-andrade/otp,getong/otp,potatosalad/otp,electricimp/otp,dumbbell/otp,dumbbell/otp,potatosalad/otp,dumbbell/otp,dumbbell/otp,mikpe/otp,mikpe/otp,kvakvs/otp,isvilen/otp,kvakvs/otp,dgud/otp,erlang/otp,vinoski/otp,bjorng/otp,dgud/otp,jj1bdx/otp,ferd/otp,g-andrade/otp,dumbbell/otp,mikpe/otp,potatosalad/otp,lrascao/otp,isvilen/otp,vinoski/otp,dgud/otp,vinoski/otp,dgud/otp,potatosalad/otp,electricimp/otp,bjorng/otp,getong/otp,erlang/otp,getong/otp,ferd/otp,electricimp/otp,isvilen/otp,g-andrade/otp,uabboli/otp,dumbbell/otp,vinoski/otp,vladdu/otp,mikpe/otp,ferd/otp,g-andrade/otp,erlang/otp,kvakvs/otp,g-andrade/otp,rlipscombe/otp,kvakvs/otp,rlipscombe/otp,emacsmirror/erlang,rlipscombe/otp,dgud/otp,mikpe/otp,kvakvs/otp,lrascao/otp,jj1bdx/otp,lrascao/otp,dumbbell/otp,jj1bdx/otp,emacsmirror/erlang,rlipscombe/otp,ferd/otp,bjorng/otp,vladdu/otp,electricimp/otp,getong/otp,bjorng/otp,emacsmirror/erlang,g-andrade/otp,electricimp/otp,getong/otp,isvilen/otp,vinoski/otp,rlipscombe/otp,g-andrade/otp,vladdu/otp,mikpe/otp,lrascao/otp,emacsmirror/erlang,uabboli/otp,emacsmirror/erlang,rlipscombe/otp,uabboli/otp,dgud/otp,dgud/otp,kvakvs/otp,getong/otp,vladdu/otp,rlipscombe/otp,dumbbell/otp,vladdu/otp,ferd/otp,mikpe/otp,dgud/otp,isvilen/otp,vladdu/otp,erlang/otp,getong/otp,emacsmirror/erlang,ferd/otp,vladdu/otp,emacsmirror/erlang,mikpe/otp,lrascao/otp,jj1bdx/otp,lrascao/otp,vinoski/otp,erlang/otp,kvakvs/otp,electricimp/otp,potatosalad/otp,vinoski/otp,bjorng/otp,potatosalad/otp,jj1bdx/otp,kvakvs/otp,g-andrade/otp,dgud/otp,kvakvs/otp,potatosalad/otp,getong/otp,getong/otp,isvilen/otp,rlipscombe/otp,erlang/otp,uabboli/otp,uabboli/otp,potatosalad/otp,bjorng/otp,erlang/otp,rlipscombe/otp