@code_warntype
output looks pretty similar. But running
t = AVLTrees.AVLTree{Int, Nothing}()
x = AVLTrees.Node{Int, Nothing}(1, nothing, nothing)
@code_typed AVLTrees.rotate_left(t, x, x)
generates
CodeInfo(
1 ββ %1 = Base.getfield(x_right, :left)::Union{Nothing, AVLTrees.Node{Int64, Nothing}}
β %2 = (%1 === AVLTrees.nothing)::Bool
β %3 = Core.Intrinsics.not_int(%2)::Bool
ββββ goto #13 if not %3
2 ββ %5 = Base.getfield(x_right, :left)::Union{Nothing, AVLTrees.Node{Int64, Nothing}}
β %6 = (isa)(%5, Nothing)::Bool
ββββ goto #4 if not %6
3 ββ Base.setfield!(x, :right, nothing)::Nothing
ββββ goto #7
4 ββ %10 = (isa)(%5, AVLTrees.Node{Int64, Nothing})::Bool
ββββ goto #6 if not %10
5 ββ %12 = Ο (%5, AVLTrees.Node{Int64, Nothing})
β Base.setfield!(x, :right, %12)::AVLTrees.Node{Int64, Nothing}
ββββ goto #7
6 ββ Core.throw(ErrorException("fatal error in type inference (type bound)"))::Union{}
ββββ unreachable
7 ββ %17 = Base.getfield(x_right, :left)::Union{Nothing, AVLTrees.Node{Int64, Nothing}}
β %18 = Base.setproperty!::Core.Const(setproperty!)
β %19 = (isa)(%17, Nothing)::Bool
ββββ goto #9 if not %19
8 ββ %21 = Ο (%17, Nothing)
β invoke %18(%21::Nothing, :parent::Symbol, _3::AVLTrees.Node{Int64, Nothing})::Any
ββββ goto #12
9 ββ %24 = (isa)(%17, AVLTrees.Node{Int64, Nothing})::Bool
ββββ goto #11 if not %24
10 β %26 = Ο (%17, AVLTrees.Node{Int64, Nothing})
β Base.setfield!(%26, :parent, x)::AVLTrees.Node{Int64, Nothing}
ββββ goto #12
11 β Core.throw(ErrorException("fatal error in type inference (type bound)"))::Union{}
ββββ unreachable
12 β goto #14
13 β Base.setfield!(x, :right, nothing)::Nothing
14 β Base.setfield!(x_right, :left, x)::AVLTrees.Node{Int64, Nothing}
β %34 = Base.getfield(x, :parent)::Union{Nothing, AVLTrees.Node{Int64, Nothing}}
β %35 = (%34 === AVLTrees.nothing)::Bool
ββββ goto #16 if not %35
15 β Base.setfield!(t, :root, x_right)::AVLTrees.Node{Int64, Nothing}
ββββ goto #24
16 β %39 = Ο (%34, AVLTrees.Node{Int64, Nothing})
β %40 = Base.getfield(%39, :left)::Union{Nothing, AVLTrees.Node{Int64, Nothing}}
β %41 = (isa)(%40, Nothing)::Bool
ββββ goto #18 if not %41
17 β goto #21
18 β %44 = (isa)(%40, AVLTrees.Node{Int64, Nothing})::Bool
ββββ goto #20 if not %44
19 β %46 = Ο (%40, AVLTrees.Node{Int64, Nothing})
β %47 = (%46 === x)::Bool
ββββ goto #21
20 β Core.throw(ErrorException("fatal error in type inference (type bound)"))::Union{}
ββββ unreachable
21 β %51 = Ο (#17 => false, #19 => %47)::Bool
ββββ goto #23 if not %51
22 β %53 = Ο (%34, AVLTrees.Node{Int64, Nothing})
β Base.setfield!(%53, :left, x_right)::AVLTrees.Node{Int64, Nothing}
ββββ goto #24
23 β %56 = Ο (%34, AVLTrees.Node{Int64, Nothing})
ββββ Base.setfield!(%56, :right, x_right)::AVLTrees.Node{Int64, Nothing}
24 β %58 = Base.setproperty!::Core.Const(setproperty!)
β %59 = (isa)(%34, Nothing)::Bool
ββββ goto #26 if not %59
25 β %61 = Ο (%34, Nothing)
β invoke %58(_4::AVLTrees.Node{Int64, Nothing}, :parent::Symbol, %61::Nothing)::Any
ββββ goto #29
26 β %64 = (isa)(%34, AVLTrees.Node{Int64, Nothing})::Bool
ββββ goto #28 if not %64
27 β %66 = Ο (%34, AVLTrees.Node{Int64, Nothing})
β Base.setfield!(x_right, :parent, %66)::AVLTrees.Node{Int64, Nothing}
ββββ goto #29
28 β Core.throw(ErrorException("fatal error in type inference (type bound)"))::Union{}
ββββ unreachable
29 β Base.setfield!(x, :parent, x_right)::AVLTrees.Node{Int64, Nothing}
β %72 = Base.getfield(x, :bf)::Int8
β %73 = Base.getfield(x_right, :bf)::Int8
β %74 = Base.getfield(x_right, :bf)::Int8
β %75 = Base.sle_int(0, %74)::Bool
β %76 = Core.bitcast(Core.Int8, %75)::Int8
β %77 = Core.and_int(%76, 1)::Int8
β %78 = Base.mul_int(%73, %77)::Int8
β %79 = Base.add_int(%78, 1)::Int8
β %80 = Base.sub_int(%72, %79)::Int8
β Base.setfield!(x, :bf, %80)::Int8
β %82 = Base.getfield(x_right, :bf)::Int8
β %83 = Base.getfield(x, :bf)::Int8
β %84 = Base.getfield(x, :bf)::Int8
β %85 = Base.slt_int(%84, 0)::Bool
β %86 = Core.bitcast(Core.Int8, %85)::Int8
β %87 = Core.and_int(%86, 1)::Int8
β %88 = Base.mul_int(%83, %87)::Int8
β %89 = Base.sub_int(%88, 1)::Int8
β %90 = Base.add_int(%82, %89)::Int8
β Base.setfield!(x_right, :bf, %90)::Int8
ββββ return x_right
) => AVLTrees.Node{Int64, Nothing}
on Julia 1.6.3 and
CodeInfo(
1 ββ %1 = Base.getfield(x_right, :left)::Union{Nothing, AVLTrees.Node{Int64, Nothing}}
β %2 = (%1 === AVLTrees.nothing)::Bool
β %3 = Core.Intrinsics.not_int(%2)::Bool
ββββ goto #13 if not %3
2 ββ %5 = Base.getfield(x_right, :left)::Union{Nothing, AVLTrees.Node{Int64, Nothing}}
β %6 = Base.setproperty!::typeof(setproperty!)
β %7 = (isa)(%5, Nothing)::Bool
ββββ goto #4 if not %7
3 ββ %9 = Ο (%5, Nothing)
β invoke %6(_3::AVLTrees.Node{Int64, Nothing}, :right::Symbol, %9::Nothing)::Any
ββββ goto #7
4 ββ %12 = (isa)(%5, AVLTrees.Node{Int64, Nothing})::Bool
ββββ goto #6 if not %12
5 ββ %14 = Ο (%5, AVLTrees.Node{Int64, Nothing})
β invoke %6(_3::AVLTrees.Node{Int64, Nothing}, :right::Symbol, %14::AVLTrees.Node{Int64, Nothing})::Any
ββββ goto #7
6 ββ Core.throw(ErrorException("fatal error in type inference (type bound)"))::Union{}
ββββ unreachable
7 ββ %19 = Base.getfield(x_right, :left)::Union{Nothing, AVLTrees.Node{Int64, Nothing}}
β %20 = Base.setproperty!::typeof(setproperty!)
β %21 = (isa)(%19, Nothing)::Bool
ββββ goto #9 if not %21
8 ββ %23 = Ο (%19, Nothing)
β invoke %20(%23::Nothing, :parent::Symbol, _3::AVLTrees.Node{Int64, Nothing})::Any
ββββ goto #12
9 ββ %26 = (isa)(%19, AVLTrees.Node{Int64, Nothing})::Bool
ββββ goto #11 if not %26
10 β %28 = Ο (%19, AVLTrees.Node{Int64, Nothing})
β invoke %20(%28::AVLTrees.Node{Int64, Nothing}, :parent::Symbol, _3::AVLTrees.Node{Int64, Nothing})::Any
ββββ goto #12
11 β Core.throw(ErrorException("fatal error in type inference (type bound)"))::Union{}
ββββ unreachable
12 β goto #14
13 β Base.setfield!(x, :right, nothing)::Nothing
14 β Base.setfield!(x_right, :left, x)::AVLTrees.Node{Int64, Nothing}
β %36 = Base.getfield(x, :parent)::Union{Nothing, AVLTrees.Node{Int64, Nothing}}
β %37 = (%36 === AVLTrees.nothing)::Bool
ββββ goto #16 if not %37
15 β Base.setfield!(t, :root, x_right)::AVLTrees.Node{Int64, Nothing}
ββββ goto #24
16 β %41 = Ο (%36, AVLTrees.Node{Int64, Nothing})
β %42 = Base.getfield(%41, :left)::Union{Nothing, AVLTrees.Node{Int64, Nothing}}
β %43 = (isa)(%42, Nothing)::Bool
ββββ goto #18 if not %43
17 β goto #21
18 β %46 = (isa)(%42, AVLTrees.Node{Int64, Nothing})::Bool
ββββ goto #20 if not %46
19 β %48 = Ο (%42, AVLTrees.Node{Int64, Nothing})
β %49 = (%48 === x)::Bool
ββββ goto #21
20 β Core.throw(ErrorException("fatal error in type inference (type bound)"))::Union{}
ββββ unreachable
21 β %53 = Ο (#17 => false, #19 => %49)::Bool
ββββ goto #23 if not %53
22 β %55 = Ο (%36, AVLTrees.Node{Int64, Nothing})
β Base.setfield!(%55, :left, x_right)::AVLTrees.Node{Int64, Nothing}
ββββ goto #24
23 β %58 = Ο (%36, AVLTrees.Node{Int64, Nothing})
ββββ Base.setfield!(%58, :right, x_right)::AVLTrees.Node{Int64, Nothing}
24 β %60 = Base.setproperty!::typeof(setproperty!)
β %61 = (isa)(%36, Nothing)::Bool
ββββ goto #26 if not %61
25 β %63 = Ο (%36, Nothing)
β invoke %60(_4::AVLTrees.Node{Int64, Nothing}, :parent::Symbol, %63::Nothing)::Any
ββββ goto #29
26 β %66 = (isa)(%36, AVLTrees.Node{Int64, Nothing})::Bool
ββββ goto #28 if not %66
27 β %68 = Ο (%36, AVLTrees.Node{Int64, Nothing})
β invoke %60(_4::AVLTrees.Node{Int64, Nothing}, :parent::Symbol, %68::AVLTrees.Node{Int64, Nothing})::Any
ββββ goto #29
28 β Core.throw(ErrorException("fatal error in type inference (type bound)"))::Union{}
ββββ unreachable
29 β Base.setfield!(x, :parent, x_right)::AVLTrees.Node{Int64, Nothing}
β %74 = Base.getfield(x, :bf)::Int8
β %75 = Base.getfield(x_right, :bf)::Int8
β %76 = Base.getfield(x_right, :bf)::Int8
β %77 = Base.sle_int(0, %76)::Bool
β %78 = Core.bitcast(Core.Int8, %77)::Int8
β %79 = Core.and_int(%78, 1)::Int8
β %80 = Base.mul_int(%75, %79)::Int8
β %81 = Base.add_int(%80, 1)::Int8
β %82 = Base.sub_int(%74, %81)::Int8
β Base.setfield!(x, :bf, %82)::Int8
β %84 = Base.getfield(x_right, :bf)::Int8
β %85 = Base.getfield(x, :bf)::Int8
β %86 = Base.getfield(x, :bf)::Int8
β %87 = Base.slt_int(%86, 0)::Bool
β %88 = Core.bitcast(Core.Int8, %87)::Int8
β %89 = Core.and_int(%88, 1)::Int8
β %90 = Base.mul_int(%85, %89)::Int8
β %91 = Base.sub_int(%90, 1)::Int8
β %92 = Base.add_int(%84, %91)::Int8
β Base.setfield!(x_right, :bf, %92)::Int8
ββββ return x_right
) => AVLTrees.Node{Int64, Nothing}
on 1.7.0-rc1.