Skip to content

Instantly share code, notes, and snippets.

@bjorng
Last active August 16, 2018 08:27
Show Gist options
  • Save bjorng/c1a24a26f43db9c9474fe871334e3e20 to your computer and use it in GitHub Desktop.
Save bjorng/c1a24a26f43db9c9474fe871334e3e20 to your computer and use it in GitHub Desktop.
Informal to-do and bug list for new the new SSA-based compiler

TO DO

  • Source code:
foo(X, Y) ->
    case X =:= $T orelse X =:= $\s of
        true -> {ok, Y};
        _ -> error
    end.

The problem is described in the comment below:

{function, foo, 2, 2}.
  {label,1}.
    {line,[{location,"t.erl",4}]}.
    {func_info,{atom,t},{atom,foo},2}.
  {label,2}.
    {test,is_eq_exact,{f,3},[{x,0},{integer,84}]}.
    {move,{atom,true},{x,0}}.
    {jump,{f,4}}.
  {label,3}.
    %% The next two lines should be a single test instruction.
    {bif,'=:=',{f,0},[{x,0},{integer,32}],{x,0}}.
    {test,is_eq_exact,{f,5},[{x,0},{atom,true}]}.
  {label,4}.
    {test_heap,3,2}.
    {put_tuple,2,{x,0}}.
    {put,{atom,ok}}.
    {put,{x,1}}.
    return.
  {label,5}.
    {move,{atom,error},{x,0}}.
    return.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment