anchor.diff:      end.
   
   shortcut_sw_list([{Lit,L0}|T], Bool, From, St0) ->
  -    RelOp = {'=:=',Bool,Lit},
  -    St = St0#st{rel_op=RelOp},
  +    Test = {'=:=',Bool,Lit},
  +    St = St0#st{test=Test},
       #b_br{bool=#b_literal{val=true},succ=L} =
           shortcut(L0, From, bind_var(Bool, Lit, #{}), St#st{target=one_way}),
       [{Lit,L}|shortcut_sw_list(T, Bool, From, St0)];
   shortcut_sw_list([], _, _, _) -> [].
   
  -shortcut(L, _From, Bs, #st{rel_op=none,target=one_way}) when map_size(Bs) =:= 0 ->
  -    %% There is no way that we can find a suitable branch, because there is no
  -    %% relational operator stored, there are no bindings, and the block L can't
  -    %% have any phi nodes from which we could pick bindings because when the target
  -    %% is `one_way`, it implies the From block has a two-way `br` terminator.
  +shortcut(L, _From, Bs, #st{test=none,target=one_way}) when map_size(Bs) =:= 0 ->
  +    %% There is no way that we can find a suitable branch, because
  +    %% there are no stored tests, there are no bindings, and the block
  +    %% L can't have any phi nodes from which we could pick bindings
  +    %% because when the target is `one_way`, it implies that the From
  +    %% block has a two-way `br` terminator.
       #b_br{bool=#b_literal{val=true},succ=L,fail=L};
   shortcut(L, From, Bs, St) ->
       shortcut_1(L, From, Bs, sets:new([{version, 2}]), St).
  
positive.code: 
  shortcut_terminator(#b_br{bool=#b_literal{val=true},succ=Succ0},
                      _Is, From, St0) ->
      St = St0#st{rel_op=none},
      shortcut(Succ0, From, #{}, St);
  shortcut_terminator(#b_br{bool=#b_var{}=Bool,succ=Succ0,fail=Fail0}=Br,
                      Is, From, St0) ->
      St = St0#st{target=one_way},
      RelOp = get_rel_op(Bool, Is),
  
      %% The boolean in a `br` is seldom used by the successors. By
      %% not binding its value unless it is actually used we might be able
      %% to skip some work in shortcut/4 and sub/2.
      SuccBs = bind_var_if_used(Succ0, Bool, #b_literal{val=true}, St),
      BrSucc = shortcut(Succ0, From, SuccBs, St#st{rel_op=RelOp}),
      FailBs = bind_var_if_used(Fail0, Bool, #b_literal{val=false}, St),
      BrFail = shortcut(Fail0, From, FailBs, St#st{rel_op=invert_op(RelOp)}),
  
      case {BrSucc,BrFail} of
          {#b_br{bool=#b_literal{val=true},succ=Succ},
  
negative.code: -type basic_type_test() :: atom() | {'is_tagged_tuple',pos_integer(),atom()}.
  -type type_test() :: basic_type_test() | {'not',basic_type_test()}.
  -type op_name() :: atom().
  -type basic_test() :: {op_name(),beam_ssa:b_var(),beam_ssa:value()} |
                        {basic_type_test(),beam_ssa:value()}.
  -type test() :: {op_name(),beam_ssa:b_var(),beam_ssa:value()} |
                  {type_test(),beam_ssa:value()}.
  
  -record(st,
          {bs :: beam_ssa:block_map(),
           us :: used_vars(),
           skippable :: #{beam_ssa:label():='true'},
           test=none :: 'none' | test(),
           target=any :: 'any' | 'one_way' | beam_ssa:label()
          }).
  
  