Skip to content

Commit

Permalink
compiler: Remove dead code from alias analysis pass
Browse files Browse the repository at this point in the history
Remove an explicit error case in the alias analysis pass which
currently is the only uncovered line in the coverage report for the
pass. During development it was helpful to have a clear-text exit
instead of a match failure when an unknown instruction was
encountered, but now as the code has matured, it is only noise in the
coverage report. Therefore remove it, as, if a new ssa instruction is
added, it will be obvious from the error message what the problem is.
  • Loading branch information
frej committed Jun 27, 2024
1 parent c178c48 commit 7679273
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/compiler/src/beam_ssa_alias.erl
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,8 @@ aa_blocks([{L,#b_blk{is=Is0,last=T}}|Bs0], Kills, Lbl2SS0, AAS0) ->
aa_blocks([], _Kills, Lbl2SS, AAS) ->
{Lbl2SS,AAS}.

aa_is([I=#b_set{dst=Dst,op=Op,args=Args,anno=Anno0}|Is], SS0, AAS0) ->
?DP("I: ~p~n", [I]),
aa_is([_I=#b_set{dst=Dst,op=Op,args=Args,anno=Anno0}|Is], SS0, AAS0) ->
?DP("I: ~p~n", [_I]),
SS1 = beam_ssa_ss:add_var(Dst, unique, SS0),
{SS, AAS} =
case Op of
Expand Down Expand Up @@ -559,11 +559,9 @@ aa_is([I=#b_set{dst=Dst,op=Op,args=Args,anno=Anno0}|Is], SS0, AAS0) ->
resume ->
{SS1, AAS0};
wait_timeout ->
{SS1, AAS0};
_ ->
exit({unknown_instruction, I})
{SS1, AAS0}
end,
?DP("Post I: ~p.~n ~p~n", [I, SS]),
?DP("Post I: ~p.~n ~p~n", [_I, SS]),
aa_is(Is, SS, AAS);
aa_is([], SS, AAS) ->
{SS, AAS}.
Expand Down

0 comments on commit 7679273

Please sign in to comment.