anchor.diff:  find_update_succ([], _, D) -> D.
   
   find_yregs_is([#b_set{dst=Dst}=I|Is], #dk{d=Defs0,k=Killed0}=Ys, Yregs0) ->
  -    Used = beam_ssa:used(I),
  -    Yregs1 = ordsets:intersection(Used, Killed0),
  -    Yregs = ordsets:union(Yregs0, Yregs1),
  +    Yregs1 = intersect_used(I, Killed0),
  +    Yregs = cerl_sets:union(Yregs0, Yregs1),
       case beam_ssa:clobbers_xregs(I) of
           false ->
               Defs = ordsets:add_element(Dst, Defs0),
               find_yregs_is(Is, Ys#dk{d=Defs}, Yregs);
           true ->
  -            Killed = ordsets:union(Defs0, Killed0),
  +            Killed = cerl_sets:union(cerl_sets:from_list(Defs0), Killed0),
               Defs = [Dst],
               find_yregs_is(Is, Ys#dk{d=Defs,k=Killed}, Yregs)
       end;
   find_yregs_is([], Ys, Yregs) -> {Yregs,Ys}.
   
   find_yregs_terminator(Terminator, #dk{k=Killed}, Yregs0) ->
  -    Used = beam_ssa:used(Terminator),
  -    Yregs = ordsets:intersection(Used, Killed),
  -    ordsets:union(Yregs0, Yregs).
  +    Yregs = intersect_used(Terminator, Killed),
  +    cerl_sets:union(Yregs0, Yregs).
  +
  +intersect_used(#b_br{bool=#b_var{}=V}, Set) ->
  +    intersect_used_keep_singleton(V, Set);
  +intersect_used(#b_ret{arg=#b_var{}=V}, Set) ->
  +    intersect_used_keep_singleton(V, Set);
  +intersect_used(#b_set{op=phi,args=Args}, Set) ->
  +    cerl_sets:from_list([V || {#b_var{}=V,_} <- Args, cerl_sets:is_element(V, Set)]);
  +intersect_used(#b_set{args=Args}, Set) ->
  +    cerl_sets:from_list(intersect_used_keep(used_args(Args), Set));
  +intersect_used(#b_switch{arg=#b_var{}=V}, Set) ->
  +    intersect_used_keep_singleton(V, Set);
  +intersect_used(_, _) -> cerl_sets:new().
  +
  +intersect_used_keep_singleton(V, Set) ->
  +    case cerl_sets:is_element(V, Set) of
  +        true -> cerl_sets:from_list([V]);
  +        false -> cerl_sets:new()
  +    end.
  +
  +intersect_used_keep(Vs, Set) ->
  +    [V || V <- Vs, cerl_sets:is_element(V, Set)].
  +
  +used_args([#b_var{}=V|As]) ->
  +    [V|used_args(As)];
  +used_args([#b_remote{mod=Mod,name=Name}|As]) ->
  +    used_args([Mod,Name|As]);
  +used_args([_|As]) ->
  +    used_args(As);
  +used_args([]) -> [].
   
   %%%
   %%% Try to reduce the size of the stack frame, by adding an explicit
  
positive.code:     case D0 of
          #{S:=#dk{d=Defs1,k=Killed1}} ->
              Defs = ordsets:intersection(Defs0, Defs1),
              Killed = ordsets:union(Killed0, Killed1),
              DK = #dk{d=Defs,k=Killed},
              D = D0#{S:=DK},
              find_update_succ(Ss, DK0, D);
  
negative.code:     St#st{ssa=Blocks}.
  
  find_yregs_1([{F,Defs}|Fs], Blocks0) ->
      DK = #dk{d=Defs,k=cerl_sets:new()},
      D0 = #{F=>DK},
      Ls = beam_ssa:rpo([F], Blocks0),
      Yregs0 = cerl_sets:new(),
      Yregs = find_yregs_2(Ls, Blocks0, D0, Yregs0),
      Blk0 = map_get(F, Blocks0),
      Blk = beam_ssa:add_anno(yregs, Yregs, Blk0),
  