<p dir="auto">In Julia master (but not in Julia 0.6) this apparently harmless function:</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="using StaticArrays

const v1 = SVector(1)
const v2 = SVector(2)
const v3 = SVector(3)
const v4 = SVector(4)

function foo()
    a, b, c, d = 1:4
    arg = @. v1 * a + v2 * b + v3 * c + v4 * d
end"><pre class="notranslate"><span class="pl-k">using</span> StaticArrays

<span class="pl-k">const</span> v1 <span class="pl-k">=</span> <span class="pl-c1">SVector</span>(<span class="pl-c1">1</span>)
<span class="pl-k">const</span> v2 <span class="pl-k">=</span> <span class="pl-c1">SVector</span>(<span class="pl-c1">2</span>)
<span class="pl-k">const</span> v3 <span class="pl-k">=</span> <span class="pl-c1">SVector</span>(<span class="pl-c1">3</span>)
<span class="pl-k">const</span> v4 <span class="pl-k">=</span> <span class="pl-c1">SVector</span>(<span class="pl-c1">4</span>)

<span class="pl-k">function</span> <span class="pl-en">foo</span>()
    a, b, c, d <span class="pl-k">=</span> <span class="pl-c1">1</span><span class="pl-k">:</span><span class="pl-c1">4</span>
    arg <span class="pl-k">=</span> <span class="pl-c1">@.</span> v1 <span class="pl-k">*</span> a <span class="pl-k">+</span> v2 <span class="pl-k">*</span> b <span class="pl-k">+</span> v3 <span class="pl-k">*</span> c <span class="pl-k">+</span> v4 <span class="pl-k">*</span> d
<span class="pl-k">end</span></pre></div>
<p dir="auto">is type-unstable:</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia&gt; @code_warntype foo()
Variables:
  #1::getfield(Main, Symbol(&quot;##1#2&quot;))
  a::Int64
  b::Int64
  c::Int64
  d::Int64
  #temp#@_7::Int64
  arg&lt;optimized out&gt;
  #temp#@_9::Tuple{Int64,Int64}
  #temp#@_10::Tuple{Int64,Int64}
  #temp#@_11::Tuple{Int64,Int64}
  #temp#@_12::Tuple{Int64,Int64}

Body:
  begin
      SSAValue(0) = $(Expr(:new, UnitRange{Int64}, 1, :((Base.select_value)((Base.sle_int)(1, 4)::Bool, 4, (Base.sub_int)(1, 1)::Int64)::Int64)))
      #temp#@_7::Int64 = (Core.getfield)(SSAValue(0), :start)::Int64
      # meta: location tuple.jl indexed_next 60
      unless (#temp#@_7::Int64 === (Base.add_int)((Core.getfield)(SSAValue(0), :stop)::Int64, 1)::Int64)::Bool goto 7
      #temp#@_9::Tuple{Int64,Int64} = (Base.throw)($(Expr(:invoke, MethodInstance for BoundsError(::Any, ::Int64), :(Base.BoundsError), SSAValue(0), 1))::BoundsError)::Union{}
      goto 9
      7: 
      #temp#@_9::Tuple{Int64,Int64} = (Core.tuple)(#temp#@_7::Int64, (Base.add_int)(#temp#@_7::Int64, 1)::Int64)::Tuple{Int64,Int64}
      9: 
      # meta: pop location
      SSAValue(1) = #temp#@_9::Tuple{Int64,Int64}
      a::Int64 = (Core.getfield)(SSAValue(1), 1)::Int64
      #temp#@_7::Int64 = (Core.getfield)(SSAValue(1), 2)::Int64
      # meta: location tuple.jl indexed_next 60
      unless (#temp#@_7::Int64 === (Base.add_int)((Core.getfield)(SSAValue(0), :stop)::Int64, 1)::Int64)::Bool goto 18
      #temp#@_10::Tuple{Int64,Int64} = (Base.throw)($(Expr(:invoke, MethodInstance for BoundsError(::Any, ::Int64), :(Base.BoundsError), SSAValue(0), 2))::BoundsError)::Union{}
      goto 20
      18: 
      #temp#@_10::Tuple{Int64,Int64} = (Core.tuple)(#temp#@_7::Int64, (Base.add_int)(#temp#@_7::Int64, 1)::Int64)::Tuple{Int64,Int64}
      20: 
      # meta: pop location
      SSAValue(2) = #temp#@_10::Tuple{Int64,Int64}
      b::Int64 = (Core.getfield)(SSAValue(2), 1)::Int64
      #temp#@_7::Int64 = (Core.getfield)(SSAValue(2), 2)::Int64
      # meta: location tuple.jl indexed_next 60
      unless (#temp#@_7::Int64 === (Base.add_int)((Core.getfield)(SSAValue(0), :stop)::Int64, 1)::Int64)::Bool goto 29
      #temp#@_11::Tuple{Int64,Int64} = (Base.throw)($(Expr(:invoke, MethodInstance for BoundsError(::Any, ::Int64), :(Base.BoundsError), SSAValue(0), 3))::BoundsError)::Union{}
      goto 31
      29: 
      #temp#@_11::Tuple{Int64,Int64} = (Core.tuple)(#temp#@_7::Int64, (Base.add_int)(#temp#@_7::Int64, 1)::Int64)::Tuple{Int64,Int64}
      31: 
      # meta: pop location
      SSAValue(3) = #temp#@_11::Tuple{Int64,Int64}
      c::Int64 = (Core.getfield)(SSAValue(3), 1)::Int64
      #temp#@_7::Int64 = (Core.getfield)(SSAValue(3), 2)::Int64
      # meta: location tuple.jl indexed_next 60
      unless (#temp#@_7::Int64 === (Base.add_int)((Core.getfield)(SSAValue(0), :stop)::Int64, 1)::Int64)::Bool goto 40
      #temp#@_12::Tuple{Int64,Int64} = (Base.throw)($(Expr(:invoke, MethodInstance for BoundsError(::Any, ::Int64), :(Base.BoundsError), SSAValue(0), 4))::BoundsError)::Union{}
      goto 42
      40: 
      #temp#@_12::Tuple{Int64,Int64} = (Core.tuple)(#temp#@_7::Int64, (Base.add_int)(#temp#@_7::Int64, 1)::Int64)::Tuple{Int64,Int64}
      42: 
      # meta: pop location
      SSAValue(4) = #temp#@_12::Tuple{Int64,Int64}
      d::Int64 = (Core.getfield)(SSAValue(4), 1)::Int64
      #temp#@_7::Int64 = (Core.getfield)(SSAValue(4), 2)::Int64
      #= line 11 =#
      #1::getfield(Main, Symbol(&quot;##1#2&quot;)) = $(Expr(:new, :(Main.##1#2)))
      # meta: location broadcast.jl broadcast 434
      # meta: location /home/mose/.julia/v0.7/StaticArrays/src/broadcast.jl broadcast_c 33
      SSAValue(10) = (Core._apply)(Core.tuple, (Size(1,),), $(Expr(:invoke, MethodInstance for broadcast_sizes(::Int64, ::SVector{1,Int64}, ::Vararg{Any,N} where N), :(StaticArrays.broadcast_sizes), :(a), :(Main.v2), :(b), :(Main.v3), :(c), :(Main.v4), :(d)))::Tuple{StaticArrays.Size{()},StaticArrays.Size{(1,)},Vararg{Any,N} where N})::Tuple{StaticArrays.Size{(1,)},StaticArrays.Size{()},StaticArrays.Size{(1,)},Vararg{Any,N} where N}
      # meta: pop locations (2)
      SSAValue(9) = (StaticArrays._broadcast)(#1::getfield(Main, Symbol(&quot;##1#2&quot;)), SSAValue(10), Main.v1, a::Int64, Main.v2, b::Int64, Main.v3, c::Int64, Main.v4, d::Int64)::Any
      return SSAValue(9)
  end::Any"><pre class="notranslate">julia<span class="pl-k">&gt;</span> <span class="pl-c1">@code_warntype</span> <span class="pl-c1">foo</span>()
Variables<span class="pl-k">:</span>
  <span class="pl-c"><span class="pl-c">#</span>1::getfield(Main, Symbol("##1#2"))</span>
  a<span class="pl-k">::</span><span class="pl-c1">Int64</span>
  b<span class="pl-k">::</span><span class="pl-c1">Int64</span>
  c<span class="pl-k">::</span><span class="pl-c1">Int64</span>
  d<span class="pl-k">::</span><span class="pl-c1">Int64</span>
  <span class="pl-c"><span class="pl-c">#</span>temp#@_7::Int64</span>
  arg<span class="pl-k">&lt;</span>optimized out<span class="pl-k">&gt;</span>
  <span class="pl-c"><span class="pl-c">#</span>temp#@_9::Tuple{Int64,Int64}</span>
  <span class="pl-c"><span class="pl-c">#</span>temp#@_10::Tuple{Int64,Int64}</span>
  <span class="pl-c"><span class="pl-c">#</span>temp#@_11::Tuple{Int64,Int64}</span>
  <span class="pl-c"><span class="pl-c">#</span>temp#@_12::Tuple{Int64,Int64}</span>

Body<span class="pl-k">:</span>
  <span class="pl-k">begin</span>
      <span class="pl-en">SSAValue</span>(<span class="pl-c1">0</span>) <span class="pl-k">=</span> <span class="pl-k">$</span>(<span class="pl-c1">Expr</span>(<span class="pl-c1">:new</span>, UnitRange{Int64}, <span class="pl-c1">1</span>, :((Base<span class="pl-k">.</span>select_value)((Base<span class="pl-k">.</span>sle_int)(<span class="pl-c1">1</span>, <span class="pl-c1">4</span>)<span class="pl-k">::</span><span class="pl-c1">Bool</span>, <span class="pl-c1">4</span>, (Base<span class="pl-k">.</span>sub_int)(<span class="pl-c1">1</span>, <span class="pl-c1">1</span>)<span class="pl-k">::</span><span class="pl-c1">Int64</span>)<span class="pl-k">::</span><span class="pl-c1">Int64</span>)))
      <span class="pl-c"><span class="pl-c">#</span>temp#@_7::Int64 = (Core.getfield)(SSAValue(0), :start)::Int64</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location tuple.jl indexed_next 60</span>
      unless (<span class="pl-c"><span class="pl-c">#</span>temp#@_7::Int64 === (Base.add_int)((Core.getfield)(SSAValue(0), :stop)::Int64, 1)::Int64)::Bool goto 7</span>
      <span class="pl-c"><span class="pl-c">#</span>temp#@_9::Tuple{Int64,Int64} = (Base.throw)($(Expr(:invoke, MethodInstance for BoundsError(::Any, ::Int64), :(Base.BoundsError), SSAValue(0), 1))::BoundsError)::Union{}</span>
      goto <span class="pl-c1">9</span>
      <span class="pl-c1">7</span><span class="pl-k">:</span> 
      <span class="pl-c"><span class="pl-c">#</span>temp#@_9::Tuple{Int64,Int64} = (Core.tuple)(#temp#@_7::Int64, (Base.add_int)(#temp#@_7::Int64, 1)::Int64)::Tuple{Int64,Int64}</span>
      <span class="pl-c1">9</span><span class="pl-k">:</span> 
      <span class="pl-c"><span class="pl-c">#</span> meta: pop location</span>
      <span class="pl-en">SSAValue</span>(<span class="pl-c1">1</span>) <span class="pl-k">=</span> <span class="pl-c"><span class="pl-c">#</span>temp#@_9::Tuple{Int64,Int64}</span>
      a<span class="pl-k">::</span><span class="pl-c1">Int64</span> <span class="pl-k">=</span> (Core<span class="pl-k">.</span>getfield)(<span class="pl-c1">SSAValue</span>(<span class="pl-c1">1</span>), <span class="pl-c1">1</span>)<span class="pl-k">::</span><span class="pl-c1">Int64</span>
      <span class="pl-c"><span class="pl-c">#</span>temp#@_7::Int64 = (Core.getfield)(SSAValue(1), 2)::Int64</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location tuple.jl indexed_next 60</span>
      unless (<span class="pl-c"><span class="pl-c">#</span>temp#@_7::Int64 === (Base.add_int)((Core.getfield)(SSAValue(0), :stop)::Int64, 1)::Int64)::Bool goto 18</span>
      <span class="pl-c"><span class="pl-c">#</span>temp#@_10::Tuple{Int64,Int64} = (Base.throw)($(Expr(:invoke, MethodInstance for BoundsError(::Any, ::Int64), :(Base.BoundsError), SSAValue(0), 2))::BoundsError)::Union{}</span>
      goto <span class="pl-c1">20</span>
      <span class="pl-c1">18</span><span class="pl-k">:</span> 
      <span class="pl-c"><span class="pl-c">#</span>temp#@_10::Tuple{Int64,Int64} = (Core.tuple)(#temp#@_7::Int64, (Base.add_int)(#temp#@_7::Int64, 1)::Int64)::Tuple{Int64,Int64}</span>
      <span class="pl-c1">20</span><span class="pl-k">:</span> 
      <span class="pl-c"><span class="pl-c">#</span> meta: pop location</span>
      <span class="pl-en">SSAValue</span>(<span class="pl-c1">2</span>) <span class="pl-k">=</span> <span class="pl-c"><span class="pl-c">#</span>temp#@_10::Tuple{Int64,Int64}</span>
      b<span class="pl-k">::</span><span class="pl-c1">Int64</span> <span class="pl-k">=</span> (Core<span class="pl-k">.</span>getfield)(<span class="pl-c1">SSAValue</span>(<span class="pl-c1">2</span>), <span class="pl-c1">1</span>)<span class="pl-k">::</span><span class="pl-c1">Int64</span>
      <span class="pl-c"><span class="pl-c">#</span>temp#@_7::Int64 = (Core.getfield)(SSAValue(2), 2)::Int64</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location tuple.jl indexed_next 60</span>
      unless (<span class="pl-c"><span class="pl-c">#</span>temp#@_7::Int64 === (Base.add_int)((Core.getfield)(SSAValue(0), :stop)::Int64, 1)::Int64)::Bool goto 29</span>
      <span class="pl-c"><span class="pl-c">#</span>temp#@_11::Tuple{Int64,Int64} = (Base.throw)($(Expr(:invoke, MethodInstance for BoundsError(::Any, ::Int64), :(Base.BoundsError), SSAValue(0), 3))::BoundsError)::Union{}</span>
      goto <span class="pl-c1">31</span>
      <span class="pl-c1">29</span><span class="pl-k">:</span> 
      <span class="pl-c"><span class="pl-c">#</span>temp#@_11::Tuple{Int64,Int64} = (Core.tuple)(#temp#@_7::Int64, (Base.add_int)(#temp#@_7::Int64, 1)::Int64)::Tuple{Int64,Int64}</span>
      <span class="pl-c1">31</span><span class="pl-k">:</span> 
      <span class="pl-c"><span class="pl-c">#</span> meta: pop location</span>
      <span class="pl-en">SSAValue</span>(<span class="pl-c1">3</span>) <span class="pl-k">=</span> <span class="pl-c"><span class="pl-c">#</span>temp#@_11::Tuple{Int64,Int64}</span>
      c<span class="pl-k">::</span><span class="pl-c1">Int64</span> <span class="pl-k">=</span> (Core<span class="pl-k">.</span>getfield)(<span class="pl-c1">SSAValue</span>(<span class="pl-c1">3</span>), <span class="pl-c1">1</span>)<span class="pl-k">::</span><span class="pl-c1">Int64</span>
      <span class="pl-c"><span class="pl-c">#</span>temp#@_7::Int64 = (Core.getfield)(SSAValue(3), 2)::Int64</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location tuple.jl indexed_next 60</span>
      unless (<span class="pl-c"><span class="pl-c">#</span>temp#@_7::Int64 === (Base.add_int)((Core.getfield)(SSAValue(0), :stop)::Int64, 1)::Int64)::Bool goto 40</span>
      <span class="pl-c"><span class="pl-c">#</span>temp#@_12::Tuple{Int64,Int64} = (Base.throw)($(Expr(:invoke, MethodInstance for BoundsError(::Any, ::Int64), :(Base.BoundsError), SSAValue(0), 4))::BoundsError)::Union{}</span>
      goto <span class="pl-c1">42</span>
      <span class="pl-c1">40</span><span class="pl-k">:</span> 
      <span class="pl-c"><span class="pl-c">#</span>temp#@_12::Tuple{Int64,Int64} = (Core.tuple)(#temp#@_7::Int64, (Base.add_int)(#temp#@_7::Int64, 1)::Int64)::Tuple{Int64,Int64}</span>
      <span class="pl-c1">42</span><span class="pl-k">:</span> 
      <span class="pl-c"><span class="pl-c">#</span> meta: pop location</span>
      <span class="pl-en">SSAValue</span>(<span class="pl-c1">4</span>) <span class="pl-k">=</span> <span class="pl-c"><span class="pl-c">#</span>temp#@_12::Tuple{Int64,Int64}</span>
      d<span class="pl-k">::</span><span class="pl-c1">Int64</span> <span class="pl-k">=</span> (Core<span class="pl-k">.</span>getfield)(<span class="pl-c1">SSAValue</span>(<span class="pl-c1">4</span>), <span class="pl-c1">1</span>)<span class="pl-k">::</span><span class="pl-c1">Int64</span>
      <span class="pl-c"><span class="pl-c">#</span>temp#@_7::Int64 = (Core.getfield)(SSAValue(4), 2)::Int64</span>
      <span class="pl-c"><span class="pl-c">#=</span> line 11 <span class="pl-c">=#</span></span>
      <span class="pl-c"><span class="pl-c">#</span>1::getfield(Main, Symbol("##1#2")) = $(Expr(:new, :(Main.##1#2)))</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location broadcast.jl broadcast 434</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location /home/mose/.julia/v0.7/StaticArrays/src/broadcast.jl broadcast_c 33</span>
      <span class="pl-en">SSAValue</span>(<span class="pl-c1">10</span>) <span class="pl-k">=</span> (Core<span class="pl-k">.</span>_apply)(Core<span class="pl-k">.</span>tuple, (<span class="pl-c1">Size</span>(<span class="pl-c1">1</span>,),), <span class="pl-k">$</span>(<span class="pl-c1">Expr</span>(<span class="pl-c1">:invoke</span>, MethodInstance <span class="pl-k">for</span> <span class="pl-c1">broadcast_sizes</span>(<span class="pl-k">::</span><span class="pl-c1">Int64</span>, <span class="pl-k">::</span><span class="pl-c1">SVector{1,Int64}</span>, <span class="pl-k">::</span><span class="pl-c1">Vararg{Any,N}</span> <span class="pl-k">where</span> N), :(StaticArrays<span class="pl-k">.</span>broadcast_sizes), :(a), :(Main<span class="pl-k">.</span>v2), :(b), :(Main<span class="pl-k">.</span>v3), :(c), :(Main<span class="pl-k">.</span>v4), :(d)))<span class="pl-k">::</span><span class="pl-c1">Tuple{StaticArrays.Size{()},StaticArrays.Size{(1,)},Vararg{Any,N} where N}</span>)<span class="pl-k">::</span><span class="pl-c1">Tuple{StaticArrays.Size{(1,)},StaticArrays.Size{()},StaticArrays.Size{(1,)},Vararg{Any,N} where N}</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: pop locations (2)</span>
      <span class="pl-en">SSAValue</span>(<span class="pl-c1">9</span>) <span class="pl-k">=</span> (StaticArrays<span class="pl-k">.</span>_broadcast)(<span class="pl-c"><span class="pl-c">#</span>1::getfield(Main, Symbol("##1#2")), SSAValue(10), Main.v1, a::Int64, Main.v2, b::Int64, Main.v3, c::Int64, Main.v4, d::Int64)::Any</span>
      <span class="pl-k">return</span> <span class="pl-c1">SSAValue</span>(<span class="pl-c1">9</span>)
  <span class="pl-k">end</span><span class="pl-k">::</span><span class="pl-c1">Any</span></pre></div>
<p dir="auto">It is instead stable if broadcast is not used (remove the <code class="notranslate">@.</code>):</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia&gt; function foo()
           a, b, c, d = 1:4
           arg = v1 * a + v2 * b + v3 * c + v4 * d
       end
foo (generic function with 1 method)

julia&gt; @code_warntype foo()
Variables:
  a::Int64
  b::Int64
  c::Int64
  d::Int64
  #temp#@_6::Int64
  arg&lt;optimized out&gt;
  #temp#@_8::Tuple{Int64,Int64}
  #temp#@_9::Tuple{Int64,Int64}
  #temp#@_10::Tuple{Int64,Int64}
  #temp#@_11::Tuple{Int64,Int64}
  #temp#@_12::SVector{1,Int64}
  #temp#@_18::SVector{1,Int64}

Body:
  begin
      SSAValue(0) = $(Expr(:new, UnitRange{Int64}, 1, :((Base.select_value)((Base.sle_int)(1, 4)::Bool, 4, (Base.sub_int)(1, 1)::Int64)::Int64)))
      #temp#@_6::Int64 = (Core.getfield)(SSAValue(0), :start)::Int64
      # meta: location tuple.jl indexed_next 60
      unless (#temp#@_6::Int64 === (Base.add_int)((Core.getfield)(SSAValue(0), :stop)::Int64, 1)::Int64)::Bool goto 7
      #temp#@_8::Tuple{Int64,Int64} = (Base.throw)($(Expr(:invoke, MethodInstance for BoundsError(::Any, ::Int64), :(Base.BoundsError), SSAValue(0), 1))::BoundsError)::Union{}
      goto 9
      7: 
      #temp#@_8::Tuple{Int64,Int64} = (Core.tuple)(#temp#@_6::Int64, (Base.add_int)(#temp#@_6::Int64, 1)::Int64)::Tuple{Int64,Int64}
      9: 
      # meta: pop location
      SSAValue(1) = #temp#@_8::Tuple{Int64,Int64}
      a::Int64 = (Core.getfield)(SSAValue(1), 1)::Int64
      #temp#@_6::Int64 = (Core.getfield)(SSAValue(1), 2)::Int64
      # meta: location tuple.jl indexed_next 60
      unless (#temp#@_6::Int64 === (Base.add_int)((Core.getfield)(SSAValue(0), :stop)::Int64, 1)::Int64)::Bool goto 18
      #temp#@_9::Tuple{Int64,Int64} = (Base.throw)($(Expr(:invoke, MethodInstance for BoundsError(::Any, ::Int64), :(Base.BoundsError), SSAValue(0), 2))::BoundsError)::Union{}
      goto 20
      18: 
      #temp#@_9::Tuple{Int64,Int64} = (Core.tuple)(#temp#@_6::Int64, (Base.add_int)(#temp#@_6::Int64, 1)::Int64)::Tuple{Int64,Int64}
      20: 
      # meta: pop location
      SSAValue(2) = #temp#@_9::Tuple{Int64,Int64}
      b::Int64 = (Core.getfield)(SSAValue(2), 1)::Int64
      #temp#@_6::Int64 = (Core.getfield)(SSAValue(2), 2)::Int64
      # meta: location tuple.jl indexed_next 60
      unless (#temp#@_6::Int64 === (Base.add_int)((Core.getfield)(SSAValue(0), :stop)::Int64, 1)::Int64)::Bool goto 29
      #temp#@_10::Tuple{Int64,Int64} = (Base.throw)($(Expr(:invoke, MethodInstance for BoundsError(::Any, ::Int64), :(Base.BoundsError), SSAValue(0), 3))::BoundsError)::Union{}
      goto 31
      29: 
      #temp#@_10::Tuple{Int64,Int64} = (Core.tuple)(#temp#@_6::Int64, (Base.add_int)(#temp#@_6::Int64, 1)::Int64)::Tuple{Int64,Int64}
      31: 
      # meta: pop location
      SSAValue(3) = #temp#@_10::Tuple{Int64,Int64}
      c::Int64 = (Core.getfield)(SSAValue(3), 1)::Int64
      #temp#@_6::Int64 = (Core.getfield)(SSAValue(3), 2)::Int64
      # meta: location tuple.jl indexed_next 60
      unless (#temp#@_6::Int64 === (Base.add_int)((Core.getfield)(SSAValue(0), :stop)::Int64, 1)::Int64)::Bool goto 40
      #temp#@_11::Tuple{Int64,Int64} = (Base.throw)($(Expr(:invoke, MethodInstance for BoundsError(::Any, ::Int64), :(Base.BoundsError), SSAValue(0), 4))::BoundsError)::Union{}
      goto 42
      40: 
      #temp#@_11::Tuple{Int64,Int64} = (Core.tuple)(#temp#@_6::Int64, (Base.add_int)(#temp#@_6::Int64, 1)::Int64)::Tuple{Int64,Int64}
      42: 
      # meta: pop location
      SSAValue(4) = #temp#@_11::Tuple{Int64,Int64}
      d::Int64 = (Core.getfield)(SSAValue(4), 1)::Int64
      #temp#@_6::Int64 = (Core.getfield)(SSAValue(4), 2)::Int64
      #= line 3 =#
      # meta: location /home/mose/.julia/v0.7/StaticArrays/src/linalg.jl * 26
      # meta: location broadcast.jl broadcast 434
      # meta: location /home/mose/.julia/v0.7/StaticArrays/src/broadcast.jl broadcast_c 33
      # meta: location /home/mose/.julia/v0.7/StaticArrays/src/broadcast.jl _broadcast 52
      # meta: location /home/mose/.julia/v0.7/StaticArrays/src/broadcast.jl @generated body
      #= line 110 =#
      SSAValue(25) = (Base.mul_int)((Base.getfield)((Core.getfield)(Main.v1, :data)::Tuple{Int64}, 1, false)::Int64, a::Int64)::Int64
      goto 57
      # meta: pop location
      57: 
      # meta: pop locations (4)
      # meta: location /home/mose/.julia/v0.7/StaticArrays/src/linalg.jl * 26
      # meta: location broadcast.jl broadcast 434
      # meta: location /home/mose/.julia/v0.7/StaticArrays/src/broadcast.jl broadcast_c 33
      # meta: location /home/mose/.julia/v0.7/StaticArrays/src/broadcast.jl _broadcast 52
      # meta: location /home/mose/.julia/v0.7/StaticArrays/src/broadcast.jl @generated body
      #= line 110 =#
      SSAValue(27) = (Base.mul_int)((Base.getfield)((Core.getfield)(Main.v2, :data)::Tuple{Int64}, 1, false)::Int64, b::Int64)::Int64
      goto 68
      # meta: pop location
      68: 
      # meta: pop locations (4)
      # meta: location /home/mose/.julia/v0.7/StaticArrays/src/linalg.jl * 26
      # meta: location broadcast.jl broadcast 434
      # meta: location /home/mose/.julia/v0.7/StaticArrays/src/broadcast.jl broadcast_c 33
      # meta: location /home/mose/.julia/v0.7/StaticArrays/src/broadcast.jl _broadcast 52
      # meta: location /home/mose/.julia/v0.7/StaticArrays/src/broadcast.jl @generated body
      #= line 110 =#
      SSAValue(29) = (Base.mul_int)((Base.getfield)((Core.getfield)(Main.v3, :data)::Tuple{Int64}, 1, false)::Int64, c::Int64)::Int64
      goto 79
      # meta: pop location
      79: 
      # meta: pop locations (4)
      # meta: location /home/mose/.julia/v0.7/StaticArrays/src/linalg.jl * 26
      # meta: location broadcast.jl broadcast 434
      # meta: location /home/mose/.julia/v0.7/StaticArrays/src/broadcast.jl broadcast_c 33
      # meta: location /home/mose/.julia/v0.7/StaticArrays/src/broadcast.jl _broadcast 52
      # meta: location /home/mose/.julia/v0.7/StaticArrays/src/broadcast.jl @generated body
      #= line 110 =#
      #temp#@_12::SVector{1,Int64} = $(Expr(:new, SVector{1,Int64}, :((StaticArrays.tuple)((Base.mul_int)((Base.getfield)((Core.getfield)(Main.v4, :data)::Tuple{Int64}, 1, false)::Int64, d)::Int64)::Tuple{Int64})))
      goto 90
      # meta: pop location
      90: 
      # meta: pop locations (4)
      # meta: location operators.jl + 469
      # meta: location /home/mose/.julia/v0.7/StaticArrays/src/linalg.jl + 10
      # meta: location /home/mose/.julia/v0.7/StaticArrays/src/mapreduce.jl map 15
      # meta: location /home/mose/.julia/v0.7/StaticArrays/src/mapreduce.jl _map 20
      # meta: location /home/mose/.julia/v0.7/StaticArrays/src/mapreduce.jl @generated body
      #= line 29 =#
      SSAValue(21) = (Base.add_int)(SSAValue(25), SSAValue(27))::Int64
      goto 101
      # meta: pop location
      101: 
      # meta: pop locations (3)
      # meta: location /home/mose/.julia/v0.7/StaticArrays/src/linalg.jl + 10
      # meta: location /home/mose/.julia/v0.7/StaticArrays/src/mapreduce.jl map 15
      # meta: location /home/mose/.julia/v0.7/StaticArrays/src/mapreduce.jl _map 20
      # meta: location /home/mose/.julia/v0.7/StaticArrays/src/mapreduce.jl @generated body
      #= line 29 =#
      SSAValue(23) = (Base.add_int)(SSAValue(21), SSAValue(29))::Int64
      goto 111
      # meta: pop location
      111: 
      # meta: pop locations (3)
      # meta: location operators.jl afoldl 456
      # meta: location /home/mose/.julia/v0.7/StaticArrays/src/linalg.jl + 10
      # meta: location /home/mose/.julia/v0.7/StaticArrays/src/mapreduce.jl map 15
      # meta: location /home/mose/.julia/v0.7/StaticArrays/src/mapreduce.jl _map 20
      # meta: location /home/mose/.julia/v0.7/StaticArrays/src/mapreduce.jl @generated body
      #= line 29 =#
      #temp#@_18::SVector{1,Int64} = $(Expr(:new, SVector{1,Int64}, :((StaticArrays.tuple)((Base.add_int)(SSAValue(23), (Base.getfield)((Core.getfield)(#temp#@_12, :data)::Tuple{Int64}, 1, false)::Int64)::Int64)::Tuple{Int64})))
      goto 122
      # meta: pop location
      122: 
      # meta: pop locations (5)
      return #temp#@_18::SVector{1,Int64}
  end::SVector{1,Int64}"><pre class="notranslate">julia<span class="pl-k">&gt;</span> <span class="pl-k">function</span> <span class="pl-en">foo</span>()
           a, b, c, d <span class="pl-k">=</span> <span class="pl-c1">1</span><span class="pl-k">:</span><span class="pl-c1">4</span>
           arg <span class="pl-k">=</span> v1 <span class="pl-k">*</span> a <span class="pl-k">+</span> v2 <span class="pl-k">*</span> b <span class="pl-k">+</span> v3 <span class="pl-k">*</span> c <span class="pl-k">+</span> v4 <span class="pl-k">*</span> d
       <span class="pl-k">end</span>
foo (generic <span class="pl-k">function</span> with <span class="pl-c1">1</span> method)

julia<span class="pl-k">&gt;</span> <span class="pl-c1">@code_warntype</span> <span class="pl-c1">foo</span>()
Variables<span class="pl-k">:</span>
  a<span class="pl-k">::</span><span class="pl-c1">Int64</span>
  b<span class="pl-k">::</span><span class="pl-c1">Int64</span>
  c<span class="pl-k">::</span><span class="pl-c1">Int64</span>
  d<span class="pl-k">::</span><span class="pl-c1">Int64</span>
  <span class="pl-c"><span class="pl-c">#</span>temp#@_6::Int64</span>
  arg<span class="pl-k">&lt;</span>optimized out<span class="pl-k">&gt;</span>
  <span class="pl-c"><span class="pl-c">#</span>temp#@_8::Tuple{Int64,Int64}</span>
  <span class="pl-c"><span class="pl-c">#</span>temp#@_9::Tuple{Int64,Int64}</span>
  <span class="pl-c"><span class="pl-c">#</span>temp#@_10::Tuple{Int64,Int64}</span>
  <span class="pl-c"><span class="pl-c">#</span>temp#@_11::Tuple{Int64,Int64}</span>
  <span class="pl-c"><span class="pl-c">#</span>temp#@_12::SVector{1,Int64}</span>
  <span class="pl-c"><span class="pl-c">#</span>temp#@_18::SVector{1,Int64}</span>

Body<span class="pl-k">:</span>
  <span class="pl-k">begin</span>
      <span class="pl-en">SSAValue</span>(<span class="pl-c1">0</span>) <span class="pl-k">=</span> <span class="pl-k">$</span>(<span class="pl-c1">Expr</span>(<span class="pl-c1">:new</span>, UnitRange{Int64}, <span class="pl-c1">1</span>, :((Base<span class="pl-k">.</span>select_value)((Base<span class="pl-k">.</span>sle_int)(<span class="pl-c1">1</span>, <span class="pl-c1">4</span>)<span class="pl-k">::</span><span class="pl-c1">Bool</span>, <span class="pl-c1">4</span>, (Base<span class="pl-k">.</span>sub_int)(<span class="pl-c1">1</span>, <span class="pl-c1">1</span>)<span class="pl-k">::</span><span class="pl-c1">Int64</span>)<span class="pl-k">::</span><span class="pl-c1">Int64</span>)))
      <span class="pl-c"><span class="pl-c">#</span>temp#@_6::Int64 = (Core.getfield)(SSAValue(0), :start)::Int64</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location tuple.jl indexed_next 60</span>
      unless (<span class="pl-c"><span class="pl-c">#</span>temp#@_6::Int64 === (Base.add_int)((Core.getfield)(SSAValue(0), :stop)::Int64, 1)::Int64)::Bool goto 7</span>
      <span class="pl-c"><span class="pl-c">#</span>temp#@_8::Tuple{Int64,Int64} = (Base.throw)($(Expr(:invoke, MethodInstance for BoundsError(::Any, ::Int64), :(Base.BoundsError), SSAValue(0), 1))::BoundsError)::Union{}</span>
      goto <span class="pl-c1">9</span>
      <span class="pl-c1">7</span><span class="pl-k">:</span> 
      <span class="pl-c"><span class="pl-c">#</span>temp#@_8::Tuple{Int64,Int64} = (Core.tuple)(#temp#@_6::Int64, (Base.add_int)(#temp#@_6::Int64, 1)::Int64)::Tuple{Int64,Int64}</span>
      <span class="pl-c1">9</span><span class="pl-k">:</span> 
      <span class="pl-c"><span class="pl-c">#</span> meta: pop location</span>
      <span class="pl-en">SSAValue</span>(<span class="pl-c1">1</span>) <span class="pl-k">=</span> <span class="pl-c"><span class="pl-c">#</span>temp#@_8::Tuple{Int64,Int64}</span>
      a<span class="pl-k">::</span><span class="pl-c1">Int64</span> <span class="pl-k">=</span> (Core<span class="pl-k">.</span>getfield)(<span class="pl-c1">SSAValue</span>(<span class="pl-c1">1</span>), <span class="pl-c1">1</span>)<span class="pl-k">::</span><span class="pl-c1">Int64</span>
      <span class="pl-c"><span class="pl-c">#</span>temp#@_6::Int64 = (Core.getfield)(SSAValue(1), 2)::Int64</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location tuple.jl indexed_next 60</span>
      unless (<span class="pl-c"><span class="pl-c">#</span>temp#@_6::Int64 === (Base.add_int)((Core.getfield)(SSAValue(0), :stop)::Int64, 1)::Int64)::Bool goto 18</span>
      <span class="pl-c"><span class="pl-c">#</span>temp#@_9::Tuple{Int64,Int64} = (Base.throw)($(Expr(:invoke, MethodInstance for BoundsError(::Any, ::Int64), :(Base.BoundsError), SSAValue(0), 2))::BoundsError)::Union{}</span>
      goto <span class="pl-c1">20</span>
      <span class="pl-c1">18</span><span class="pl-k">:</span> 
      <span class="pl-c"><span class="pl-c">#</span>temp#@_9::Tuple{Int64,Int64} = (Core.tuple)(#temp#@_6::Int64, (Base.add_int)(#temp#@_6::Int64, 1)::Int64)::Tuple{Int64,Int64}</span>
      <span class="pl-c1">20</span><span class="pl-k">:</span> 
      <span class="pl-c"><span class="pl-c">#</span> meta: pop location</span>
      <span class="pl-en">SSAValue</span>(<span class="pl-c1">2</span>) <span class="pl-k">=</span> <span class="pl-c"><span class="pl-c">#</span>temp#@_9::Tuple{Int64,Int64}</span>
      b<span class="pl-k">::</span><span class="pl-c1">Int64</span> <span class="pl-k">=</span> (Core<span class="pl-k">.</span>getfield)(<span class="pl-c1">SSAValue</span>(<span class="pl-c1">2</span>), <span class="pl-c1">1</span>)<span class="pl-k">::</span><span class="pl-c1">Int64</span>
      <span class="pl-c"><span class="pl-c">#</span>temp#@_6::Int64 = (Core.getfield)(SSAValue(2), 2)::Int64</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location tuple.jl indexed_next 60</span>
      unless (<span class="pl-c"><span class="pl-c">#</span>temp#@_6::Int64 === (Base.add_int)((Core.getfield)(SSAValue(0), :stop)::Int64, 1)::Int64)::Bool goto 29</span>
      <span class="pl-c"><span class="pl-c">#</span>temp#@_10::Tuple{Int64,Int64} = (Base.throw)($(Expr(:invoke, MethodInstance for BoundsError(::Any, ::Int64), :(Base.BoundsError), SSAValue(0), 3))::BoundsError)::Union{}</span>
      goto <span class="pl-c1">31</span>
      <span class="pl-c1">29</span><span class="pl-k">:</span> 
      <span class="pl-c"><span class="pl-c">#</span>temp#@_10::Tuple{Int64,Int64} = (Core.tuple)(#temp#@_6::Int64, (Base.add_int)(#temp#@_6::Int64, 1)::Int64)::Tuple{Int64,Int64}</span>
      <span class="pl-c1">31</span><span class="pl-k">:</span> 
      <span class="pl-c"><span class="pl-c">#</span> meta: pop location</span>
      <span class="pl-en">SSAValue</span>(<span class="pl-c1">3</span>) <span class="pl-k">=</span> <span class="pl-c"><span class="pl-c">#</span>temp#@_10::Tuple{Int64,Int64}</span>
      c<span class="pl-k">::</span><span class="pl-c1">Int64</span> <span class="pl-k">=</span> (Core<span class="pl-k">.</span>getfield)(<span class="pl-c1">SSAValue</span>(<span class="pl-c1">3</span>), <span class="pl-c1">1</span>)<span class="pl-k">::</span><span class="pl-c1">Int64</span>
      <span class="pl-c"><span class="pl-c">#</span>temp#@_6::Int64 = (Core.getfield)(SSAValue(3), 2)::Int64</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location tuple.jl indexed_next 60</span>
      unless (<span class="pl-c"><span class="pl-c">#</span>temp#@_6::Int64 === (Base.add_int)((Core.getfield)(SSAValue(0), :stop)::Int64, 1)::Int64)::Bool goto 40</span>
      <span class="pl-c"><span class="pl-c">#</span>temp#@_11::Tuple{Int64,Int64} = (Base.throw)($(Expr(:invoke, MethodInstance for BoundsError(::Any, ::Int64), :(Base.BoundsError), SSAValue(0), 4))::BoundsError)::Union{}</span>
      goto <span class="pl-c1">42</span>
      <span class="pl-c1">40</span><span class="pl-k">:</span> 
      <span class="pl-c"><span class="pl-c">#</span>temp#@_11::Tuple{Int64,Int64} = (Core.tuple)(#temp#@_6::Int64, (Base.add_int)(#temp#@_6::Int64, 1)::Int64)::Tuple{Int64,Int64}</span>
      <span class="pl-c1">42</span><span class="pl-k">:</span> 
      <span class="pl-c"><span class="pl-c">#</span> meta: pop location</span>
      <span class="pl-en">SSAValue</span>(<span class="pl-c1">4</span>) <span class="pl-k">=</span> <span class="pl-c"><span class="pl-c">#</span>temp#@_11::Tuple{Int64,Int64}</span>
      d<span class="pl-k">::</span><span class="pl-c1">Int64</span> <span class="pl-k">=</span> (Core<span class="pl-k">.</span>getfield)(<span class="pl-c1">SSAValue</span>(<span class="pl-c1">4</span>), <span class="pl-c1">1</span>)<span class="pl-k">::</span><span class="pl-c1">Int64</span>
      <span class="pl-c"><span class="pl-c">#</span>temp#@_6::Int64 = (Core.getfield)(SSAValue(4), 2)::Int64</span>
      <span class="pl-c"><span class="pl-c">#=</span> line 3 <span class="pl-c">=#</span></span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location /home/mose/.julia/v0.7/StaticArrays/src/linalg.jl * 26</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location broadcast.jl broadcast 434</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location /home/mose/.julia/v0.7/StaticArrays/src/broadcast.jl broadcast_c 33</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location /home/mose/.julia/v0.7/StaticArrays/src/broadcast.jl _broadcast 52</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location /home/mose/.julia/v0.7/StaticArrays/src/broadcast.jl @generated body</span>
      <span class="pl-c"><span class="pl-c">#=</span> line 110 <span class="pl-c">=#</span></span>
      <span class="pl-en">SSAValue</span>(<span class="pl-c1">25</span>) <span class="pl-k">=</span> (Base<span class="pl-k">.</span>mul_int)((Base<span class="pl-k">.</span>getfield)((Core<span class="pl-k">.</span>getfield)(Main<span class="pl-k">.</span>v1, <span class="pl-c1">:data</span>)<span class="pl-k">::</span><span class="pl-c1">Tuple{Int64}</span>, <span class="pl-c1">1</span>, <span class="pl-c1">false</span>)<span class="pl-k">::</span><span class="pl-c1">Int64</span>, a<span class="pl-k">::</span><span class="pl-c1">Int64</span>)<span class="pl-k">::</span><span class="pl-c1">Int64</span>
      goto <span class="pl-c1">57</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: pop location</span>
      <span class="pl-c1">57</span><span class="pl-k">:</span> 
      <span class="pl-c"><span class="pl-c">#</span> meta: pop locations (4)</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location /home/mose/.julia/v0.7/StaticArrays/src/linalg.jl * 26</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location broadcast.jl broadcast 434</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location /home/mose/.julia/v0.7/StaticArrays/src/broadcast.jl broadcast_c 33</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location /home/mose/.julia/v0.7/StaticArrays/src/broadcast.jl _broadcast 52</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location /home/mose/.julia/v0.7/StaticArrays/src/broadcast.jl @generated body</span>
      <span class="pl-c"><span class="pl-c">#=</span> line 110 <span class="pl-c">=#</span></span>
      <span class="pl-en">SSAValue</span>(<span class="pl-c1">27</span>) <span class="pl-k">=</span> (Base<span class="pl-k">.</span>mul_int)((Base<span class="pl-k">.</span>getfield)((Core<span class="pl-k">.</span>getfield)(Main<span class="pl-k">.</span>v2, <span class="pl-c1">:data</span>)<span class="pl-k">::</span><span class="pl-c1">Tuple{Int64}</span>, <span class="pl-c1">1</span>, <span class="pl-c1">false</span>)<span class="pl-k">::</span><span class="pl-c1">Int64</span>, b<span class="pl-k">::</span><span class="pl-c1">Int64</span>)<span class="pl-k">::</span><span class="pl-c1">Int64</span>
      goto <span class="pl-c1">68</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: pop location</span>
      <span class="pl-c1">68</span><span class="pl-k">:</span> 
      <span class="pl-c"><span class="pl-c">#</span> meta: pop locations (4)</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location /home/mose/.julia/v0.7/StaticArrays/src/linalg.jl * 26</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location broadcast.jl broadcast 434</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location /home/mose/.julia/v0.7/StaticArrays/src/broadcast.jl broadcast_c 33</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location /home/mose/.julia/v0.7/StaticArrays/src/broadcast.jl _broadcast 52</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location /home/mose/.julia/v0.7/StaticArrays/src/broadcast.jl @generated body</span>
      <span class="pl-c"><span class="pl-c">#=</span> line 110 <span class="pl-c">=#</span></span>
      <span class="pl-en">SSAValue</span>(<span class="pl-c1">29</span>) <span class="pl-k">=</span> (Base<span class="pl-k">.</span>mul_int)((Base<span class="pl-k">.</span>getfield)((Core<span class="pl-k">.</span>getfield)(Main<span class="pl-k">.</span>v3, <span class="pl-c1">:data</span>)<span class="pl-k">::</span><span class="pl-c1">Tuple{Int64}</span>, <span class="pl-c1">1</span>, <span class="pl-c1">false</span>)<span class="pl-k">::</span><span class="pl-c1">Int64</span>, c<span class="pl-k">::</span><span class="pl-c1">Int64</span>)<span class="pl-k">::</span><span class="pl-c1">Int64</span>
      goto <span class="pl-c1">79</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: pop location</span>
      <span class="pl-c1">79</span><span class="pl-k">:</span> 
      <span class="pl-c"><span class="pl-c">#</span> meta: pop locations (4)</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location /home/mose/.julia/v0.7/StaticArrays/src/linalg.jl * 26</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location broadcast.jl broadcast 434</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location /home/mose/.julia/v0.7/StaticArrays/src/broadcast.jl broadcast_c 33</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location /home/mose/.julia/v0.7/StaticArrays/src/broadcast.jl _broadcast 52</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location /home/mose/.julia/v0.7/StaticArrays/src/broadcast.jl @generated body</span>
      <span class="pl-c"><span class="pl-c">#=</span> line 110 <span class="pl-c">=#</span></span>
      <span class="pl-c"><span class="pl-c">#</span>temp#@_12::SVector{1,Int64} = $(Expr(:new, SVector{1,Int64}, :((StaticArrays.tuple)((Base.mul_int)((Base.getfield)((Core.getfield)(Main.v4, :data)::Tuple{Int64}, 1, false)::Int64, d)::Int64)::Tuple{Int64})))</span>
      goto <span class="pl-c1">90</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: pop location</span>
      <span class="pl-c1">90</span><span class="pl-k">:</span> 
      <span class="pl-c"><span class="pl-c">#</span> meta: pop locations (4)</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location operators.jl + 469</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location /home/mose/.julia/v0.7/StaticArrays/src/linalg.jl + 10</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location /home/mose/.julia/v0.7/StaticArrays/src/mapreduce.jl map 15</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location /home/mose/.julia/v0.7/StaticArrays/src/mapreduce.jl _map 20</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location /home/mose/.julia/v0.7/StaticArrays/src/mapreduce.jl @generated body</span>
      <span class="pl-c"><span class="pl-c">#=</span> line 29 <span class="pl-c">=#</span></span>
      <span class="pl-en">SSAValue</span>(<span class="pl-c1">21</span>) <span class="pl-k">=</span> (Base<span class="pl-k">.</span>add_int)(<span class="pl-c1">SSAValue</span>(<span class="pl-c1">25</span>), <span class="pl-c1">SSAValue</span>(<span class="pl-c1">27</span>))<span class="pl-k">::</span><span class="pl-c1">Int64</span>
      goto <span class="pl-c1">101</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: pop location</span>
      <span class="pl-c1">101</span><span class="pl-k">:</span> 
      <span class="pl-c"><span class="pl-c">#</span> meta: pop locations (3)</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location /home/mose/.julia/v0.7/StaticArrays/src/linalg.jl + 10</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location /home/mose/.julia/v0.7/StaticArrays/src/mapreduce.jl map 15</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location /home/mose/.julia/v0.7/StaticArrays/src/mapreduce.jl _map 20</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location /home/mose/.julia/v0.7/StaticArrays/src/mapreduce.jl @generated body</span>
      <span class="pl-c"><span class="pl-c">#=</span> line 29 <span class="pl-c">=#</span></span>
      <span class="pl-en">SSAValue</span>(<span class="pl-c1">23</span>) <span class="pl-k">=</span> (Base<span class="pl-k">.</span>add_int)(<span class="pl-c1">SSAValue</span>(<span class="pl-c1">21</span>), <span class="pl-c1">SSAValue</span>(<span class="pl-c1">29</span>))<span class="pl-k">::</span><span class="pl-c1">Int64</span>
      goto <span class="pl-c1">111</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: pop location</span>
      <span class="pl-c1">111</span><span class="pl-k">:</span> 
      <span class="pl-c"><span class="pl-c">#</span> meta: pop locations (3)</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location operators.jl afoldl 456</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location /home/mose/.julia/v0.7/StaticArrays/src/linalg.jl + 10</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location /home/mose/.julia/v0.7/StaticArrays/src/mapreduce.jl map 15</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location /home/mose/.julia/v0.7/StaticArrays/src/mapreduce.jl _map 20</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: location /home/mose/.julia/v0.7/StaticArrays/src/mapreduce.jl @generated body</span>
      <span class="pl-c"><span class="pl-c">#=</span> line 29 <span class="pl-c">=#</span></span>
      <span class="pl-c"><span class="pl-c">#</span>temp#@_18::SVector{1,Int64} = $(Expr(:new, SVector{1,Int64}, :((StaticArrays.tuple)((Base.add_int)(SSAValue(23), (Base.getfield)((Core.getfield)(#temp#@_12, :data)::Tuple{Int64}, 1, false)::Int64)::Int64)::Tuple{Int64})))</span>
      goto <span class="pl-c1">122</span>
      <span class="pl-c"><span class="pl-c">#</span> meta: pop location</span>
      <span class="pl-c1">122</span><span class="pl-k">:</span> 
      <span class="pl-c"><span class="pl-c">#</span> meta: pop locations (5)</span>
      <span class="pl-k">return</span> <span class="pl-c"><span class="pl-c">#</span>temp#@_18::SVector{1,Int64}</span>
  <span class="pl-k">end</span><span class="pl-k">::</span><span class="pl-c1">SVector{1,Int64}</span></pre></div>
<p dir="auto">First reported at <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="265926863" data-permission-text="Title is private" data-url="https://github.com/JuliaArrays/StaticArrays.jl/issues/321" data-hovercard-type="issue" data-hovercard-url="/JuliaArrays/StaticArrays.jl/issues/321/hovercard" href="https://github.com/JuliaArrays/StaticArrays.jl/issues/321">JuliaArrays/StaticArrays.jl#321</a>.</p>
<h3 dir="auto">Updated OP</h3>
<p dir="auto">While working through the issue, <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jebej/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jebej">@jebej</a> identified that the problem is fusing 12+ broadcasts in this comment (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="234026490" data-permission-text="Title is private" data-url="https://github.com/JuliaLang/julia/issues/22255" data-hovercard-type="issue" data-hovercard-url="/JuliaLang/julia/issues/22255/hovercard?comment_id=306814370&amp;comment_type=issue_comment" href="https://github.com/JuliaLang/julia/issues/22255#issuecomment-306814370">#22255 (comment)</a>) which contains an MWE.</p>
<h3 dir="auto">Original OP</h3>
<p dir="auto">In OrdinaryDiffEq.jl, I see a 10x performance regression due to using broadcast. With the testing code:</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const ζ = 0.5
const ω₀ = 10.0

using OrdinaryDiffEq, DiffEqBase

const y₀ = Float64[0., sqrt(1-ζ^2)*ω₀]
const A = 1
const ϕ = 0


function f(t::Float64)
    α = sqrt(1-ζ^2)*ω₀
    x = A*exp(-ζ*ω₀*t)*sin(α*t + ϕ)
    p = A*exp(-ζ*ω₀*t)*(-ζ*ω₀*sin(α*t + ϕ) + α*cos(α*t + ϕ))
    return [x,p]
end

function df(t::Float64, y::Vector{Float64}, dy::Vector{Float64})
    dy[1] = y[2]
    dy[2] = -2*ζ*ω₀*y[2] - ω₀^2*y[1]
    return nothing
end

const T = [0.,10.]
using BenchmarkTools
prob = ODEProblem(df,y₀,(T[1],T[2]))
@benchmark init($prob,Tsit5(),dense=false,dt=1/10)
@benchmark solve($prob,Tsit5(),dense=false,dt=1/10)

using ProfileView

@profile for i in 1:1000; solve(prob,Tsit5(),dense=false,dt=1/10); end
ProfileView.view()"><pre class="notranslate"><span class="pl-k">const</span> ζ <span class="pl-k">=</span> <span class="pl-c1">0.5</span>
<span class="pl-k">const</span> ω₀ <span class="pl-k">=</span> <span class="pl-c1">10.0</span>

<span class="pl-k">using</span> OrdinaryDiffEq, DiffEqBase

<span class="pl-k">const</span> y₀ <span class="pl-k">=</span> Float64[<span class="pl-c1">0.</span>, <span class="pl-c1">sqrt</span>(<span class="pl-c1">1</span><span class="pl-k">-</span>ζ<span class="pl-k">^</span><span class="pl-c1">2</span>)<span class="pl-k">*</span>ω₀]
<span class="pl-k">const</span> A <span class="pl-k">=</span> <span class="pl-c1">1</span>
<span class="pl-k">const</span> ϕ <span class="pl-k">=</span> <span class="pl-c1">0</span>


<span class="pl-k">function</span> <span class="pl-en">f</span>(t<span class="pl-k">::</span><span class="pl-c1">Float64</span>)
    α <span class="pl-k">=</span> <span class="pl-c1">sqrt</span>(<span class="pl-c1">1</span><span class="pl-k">-</span>ζ<span class="pl-k">^</span><span class="pl-c1">2</span>)<span class="pl-k">*</span>ω₀
    x <span class="pl-k">=</span> A<span class="pl-k">*</span><span class="pl-c1">exp</span>(<span class="pl-k">-</span>ζ<span class="pl-k">*</span>ω₀<span class="pl-k">*</span>t)<span class="pl-k">*</span><span class="pl-c1">sin</span>(α<span class="pl-k">*</span>t <span class="pl-k">+</span> ϕ)
    p <span class="pl-k">=</span> A<span class="pl-k">*</span><span class="pl-c1">exp</span>(<span class="pl-k">-</span>ζ<span class="pl-k">*</span>ω₀<span class="pl-k">*</span>t)<span class="pl-k">*</span>(<span class="pl-k">-</span>ζ<span class="pl-k">*</span>ω₀<span class="pl-k">*</span><span class="pl-c1">sin</span>(α<span class="pl-k">*</span>t <span class="pl-k">+</span> ϕ) <span class="pl-k">+</span> α<span class="pl-k">*</span><span class="pl-c1">cos</span>(α<span class="pl-k">*</span>t <span class="pl-k">+</span> ϕ))
    <span class="pl-k">return</span> [x,p]
<span class="pl-k">end</span>

<span class="pl-k">function</span> <span class="pl-en">df</span>(t<span class="pl-k">::</span><span class="pl-c1">Float64</span>, y<span class="pl-k">::</span><span class="pl-c1">Vector{Float64}</span>, dy<span class="pl-k">::</span><span class="pl-c1">Vector{Float64}</span>)
    dy[<span class="pl-c1">1</span>] <span class="pl-k">=</span> y[<span class="pl-c1">2</span>]
    dy[<span class="pl-c1">2</span>] <span class="pl-k">=</span> <span class="pl-k">-</span><span class="pl-c1">2</span><span class="pl-k">*</span>ζ<span class="pl-k">*</span>ω₀<span class="pl-k">*</span>y[<span class="pl-c1">2</span>] <span class="pl-k">-</span> ω₀<span class="pl-k">^</span><span class="pl-c1">2</span><span class="pl-k">*</span>y[<span class="pl-c1">1</span>]
    <span class="pl-k">return</span> <span class="pl-c1">nothing</span>
<span class="pl-k">end</span>

<span class="pl-k">const</span> T <span class="pl-k">=</span> [<span class="pl-c1">0.</span>,<span class="pl-c1">10.</span>]
<span class="pl-k">using</span> BenchmarkTools
prob <span class="pl-k">=</span> <span class="pl-c1">ODEProblem</span>(df,y₀,(T[<span class="pl-c1">1</span>],T[<span class="pl-c1">2</span>]))
<span class="pl-c1">@benchmark</span> <span class="pl-c1">init</span>(<span class="pl-k">$</span>prob,<span class="pl-c1">Tsit5</span>(),dense<span class="pl-k">=</span><span class="pl-c1">false</span>,dt<span class="pl-k">=</span><span class="pl-c1">1</span><span class="pl-k">/</span><span class="pl-c1">10</span>)
<span class="pl-c1">@benchmark</span> <span class="pl-c1">solve</span>(<span class="pl-k">$</span>prob,<span class="pl-c1">Tsit5</span>(),dense<span class="pl-k">=</span><span class="pl-c1">false</span>,dt<span class="pl-k">=</span><span class="pl-c1">1</span><span class="pl-k">/</span><span class="pl-c1">10</span>)

<span class="pl-k">using</span> ProfileView

<span class="pl-c1">@profile</span> <span class="pl-k">for</span> i <span class="pl-k">in</span> <span class="pl-c1">1</span><span class="pl-k">:</span><span class="pl-c1">1000</span>; <span class="pl-c1">solve</span>(prob,<span class="pl-c1">Tsit5</span>(),dense<span class="pl-k">=</span><span class="pl-c1">false</span>,dt<span class="pl-k">=</span><span class="pl-c1">1</span><span class="pl-k">/</span><span class="pl-c1">10</span>); <span class="pl-k">end</span>
ProfileView<span class="pl-k">.</span><span class="pl-c1">view</span>()</pre></div>
<p dir="auto">I get a 10x regression by changing the inner loop from:</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="function perform_step!(integrator,cache::Tsit5Cache,f=integrator.f)
  @unpack t,dt,uprev,u,k = integrator
  uidx = eachindex(integrator.uprev)
  @unpack c1,c2,c3,c4,c5,c6,a21,a31,a32,a41,a42,a43,a51,a52,a53,a54,a61,a62,a63,a64,a65,a71,a72,a73,a74,a75,a76,b1,b2,b3,b4,b5,b6,b7 = cache.tab
  @unpack k1,k2,k3,k4,k5,k6,k7,utilde,tmp,atmp = cache
  a = dt*a21
  for i in uidx
    tmp[i] = @muladd uprev[i]+a*k1[i]
  end
  f(@muladd(t+c1*dt),tmp,k2)
  for i in uidx
    tmp[i] = @muladd uprev[i]+dt*(a31*k1[i]+a32*k2[i])
  end
  f(@muladd(t+c2*dt),tmp,k3)
  for i in uidx
    tmp[i] = @muladd uprev[i]+dt*(a41*k1[i]+a42*k2[i]+a43*k3[i])
  end
  f(@muladd(t+c3*dt),tmp,k4)
  for i in uidx
    tmp[i] = @muladd uprev[i]+dt*(a51*k1[i]+a52*k2[i]+a53*k3[i]+a54*k4[i])
  end
  f(@muladd(t+c4*dt),tmp,k5)
  for i in uidx
    tmp[i] = @muladd uprev[i]+dt*(a61*k1[i]+a62*k2[i]+a63*k3[i]+a64*k4[i]+a65*k5[i])
  end
  f(t+dt,tmp,k6)
  for i in uidx
    u[i] = @muladd uprev[i]+dt*(a71*k1[i]+a72*k2[i]+a73*k3[i]+a74*k4[i]+a75*k5[i]+a76*k6[i])
  end
  f(t+dt,u,k7)
  if integrator.opts.adaptive
    for i in uidx
      utilde[i] = @muladd uprev[i] + dt*(b1*k1[i] + b2*k2[i] + b3*k3[i] + b4*k4[i] + b5*k5[i] + b6*k6[i] + b7*k7[i])
      atmp[i] = ((utilde[i]-u[i])./@muladd(integrator.opts.abstol+max(abs(uprev[i]),abs(u[i])).*integrator.opts.reltol))
    end
    integrator.EEst = integrator.opts.internalnorm(atmp)
  end
  @pack integrator = t,dt,u,k
end"><pre class="notranslate"><span class="pl-k">function</span> <span class="pl-en">perform_step!</span>(integrator,cache<span class="pl-k">::</span><span class="pl-c1">Tsit5Cache</span>,f<span class="pl-k">=</span>integrator<span class="pl-k">.</span>f)
  <span class="pl-c1">@unpack</span> t,dt,uprev,u,k <span class="pl-k">=</span> integrator
  uidx <span class="pl-k">=</span> <span class="pl-c1">eachindex</span>(integrator<span class="pl-k">.</span>uprev)
  <span class="pl-c1">@unpack</span> c1,c2,c3,c4,c5,c6,a21,a31,a32,a41,a42,a43,a51,a52,a53,a54,a61,a62,a63,a64,a65,a71,a72,a73,a74,a75,a76,b1,b2,b3,b4,b5,b6,b7 <span class="pl-k">=</span> cache<span class="pl-k">.</span>tab
  <span class="pl-c1">@unpack</span> k1,k2,k3,k4,k5,k6,k7,utilde,tmp,atmp <span class="pl-k">=</span> cache
  a <span class="pl-k">=</span> dt<span class="pl-k">*</span>a21
  <span class="pl-k">for</span> i <span class="pl-k">in</span> uidx
    tmp[i] <span class="pl-k">=</span> <span class="pl-c1">@muladd</span> uprev[i]<span class="pl-k">+</span>a<span class="pl-k">*</span>k1[i]
  <span class="pl-k">end</span>
  <span class="pl-c1">f</span>(<span class="pl-c1">@muladd</span>(t<span class="pl-k">+</span>c1<span class="pl-k">*</span>dt),tmp,k2)
  <span class="pl-k">for</span> i <span class="pl-k">in</span> uidx
    tmp[i] <span class="pl-k">=</span> <span class="pl-c1">@muladd</span> uprev[i]<span class="pl-k">+</span>dt<span class="pl-k">*</span>(a31<span class="pl-k">*</span>k1[i]<span class="pl-k">+</span>a32<span class="pl-k">*</span>k2[i])
  <span class="pl-k">end</span>
  <span class="pl-c1">f</span>(<span class="pl-c1">@muladd</span>(t<span class="pl-k">+</span>c2<span class="pl-k">*</span>dt),tmp,k3)
  <span class="pl-k">for</span> i <span class="pl-k">in</span> uidx
    tmp[i] <span class="pl-k">=</span> <span class="pl-c1">@muladd</span> uprev[i]<span class="pl-k">+</span>dt<span class="pl-k">*</span>(a41<span class="pl-k">*</span>k1[i]<span class="pl-k">+</span>a42<span class="pl-k">*</span>k2[i]<span class="pl-k">+</span>a43<span class="pl-k">*</span>k3[i])
  <span class="pl-k">end</span>
  <span class="pl-c1">f</span>(<span class="pl-c1">@muladd</span>(t<span class="pl-k">+</span>c3<span class="pl-k">*</span>dt),tmp,k4)
  <span class="pl-k">for</span> i <span class="pl-k">in</span> uidx
    tmp[i] <span class="pl-k">=</span> <span class="pl-c1">@muladd</span> uprev[i]<span class="pl-k">+</span>dt<span class="pl-k">*</span>(a51<span class="pl-k">*</span>k1[i]<span class="pl-k">+</span>a52<span class="pl-k">*</span>k2[i]<span class="pl-k">+</span>a53<span class="pl-k">*</span>k3[i]<span class="pl-k">+</span>a54<span class="pl-k">*</span>k4[i])
  <span class="pl-k">end</span>
  <span class="pl-c1">f</span>(<span class="pl-c1">@muladd</span>(t<span class="pl-k">+</span>c4<span class="pl-k">*</span>dt),tmp,k5)
  <span class="pl-k">for</span> i <span class="pl-k">in</span> uidx
    tmp[i] <span class="pl-k">=</span> <span class="pl-c1">@muladd</span> uprev[i]<span class="pl-k">+</span>dt<span class="pl-k">*</span>(a61<span class="pl-k">*</span>k1[i]<span class="pl-k">+</span>a62<span class="pl-k">*</span>k2[i]<span class="pl-k">+</span>a63<span class="pl-k">*</span>k3[i]<span class="pl-k">+</span>a64<span class="pl-k">*</span>k4[i]<span class="pl-k">+</span>a65<span class="pl-k">*</span>k5[i])
  <span class="pl-k">end</span>
  <span class="pl-c1">f</span>(t<span class="pl-k">+</span>dt,tmp,k6)
  <span class="pl-k">for</span> i <span class="pl-k">in</span> uidx
    u[i] <span class="pl-k">=</span> <span class="pl-c1">@muladd</span> uprev[i]<span class="pl-k">+</span>dt<span class="pl-k">*</span>(a71<span class="pl-k">*</span>k1[i]<span class="pl-k">+</span>a72<span class="pl-k">*</span>k2[i]<span class="pl-k">+</span>a73<span class="pl-k">*</span>k3[i]<span class="pl-k">+</span>a74<span class="pl-k">*</span>k4[i]<span class="pl-k">+</span>a75<span class="pl-k">*</span>k5[i]<span class="pl-k">+</span>a76<span class="pl-k">*</span>k6[i])
  <span class="pl-k">end</span>
  <span class="pl-c1">f</span>(t<span class="pl-k">+</span>dt,u,k7)
  <span class="pl-k">if</span> integrator<span class="pl-k">.</span>opts<span class="pl-k">.</span>adaptive
    <span class="pl-k">for</span> i <span class="pl-k">in</span> uidx
      utilde[i] <span class="pl-k">=</span> <span class="pl-c1">@muladd</span> uprev[i] <span class="pl-k">+</span> dt<span class="pl-k">*</span>(b1<span class="pl-k">*</span>k1[i] <span class="pl-k">+</span> b2<span class="pl-k">*</span>k2[i] <span class="pl-k">+</span> b3<span class="pl-k">*</span>k3[i] <span class="pl-k">+</span> b4<span class="pl-k">*</span>k4[i] <span class="pl-k">+</span> b5<span class="pl-k">*</span>k5[i] <span class="pl-k">+</span> b6<span class="pl-k">*</span>k6[i] <span class="pl-k">+</span> b7<span class="pl-k">*</span>k7[i])
      atmp[i] <span class="pl-k">=</span> ((utilde[i]<span class="pl-k">-</span>u[i])<span class="pl-k">.</span><span class="pl-k">/</span><span class="pl-c1">@muladd</span>(integrator<span class="pl-k">.</span>opts<span class="pl-k">.</span>abstol<span class="pl-k">+</span><span class="pl-c1">max</span>(<span class="pl-c1">abs</span>(uprev[i]),<span class="pl-c1">abs</span>(u[i]))<span class="pl-k">.*</span>integrator<span class="pl-k">.</span>opts<span class="pl-k">.</span>reltol))
    <span class="pl-k">end</span>
    integrator<span class="pl-k">.</span>EEst <span class="pl-k">=</span> integrator<span class="pl-k">.</span>opts<span class="pl-k">.</span><span class="pl-c1">internalnorm</span>(atmp)
  <span class="pl-k">end</span>
  <span class="pl-c1">@pack</span> integrator <span class="pl-k">=</span> t,dt,u,k
<span class="pl-k">end</span></pre></div>
<p dir="auto">to:</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="function perform_step!(integrator,cache::Tsit5Cache,f=integrator.f)
  @unpack t,dt,uprev,u,k = integrator
  @unpack c1,c2,c3,c4,c5,c6,a21,a31,a32,a41,a42,a43,a51,a52,a53,a54,a61,a62,a63,a64,a65,a71,a72,a73,a74,a75,a76,b1,b2,b3,b4,b5,b6,b7 = cache.tab
  @unpack k1,k2,k3,k4,k5,k6,k7,utilde,tmp,atmp = cache
  a = dt*a21
  tmp .= @muladd uprev+a*k1
  f(@muladd(t+c1*dt),tmp,k2)
  tmp .= @muladd uprev+dt*(a31*k1+a32*k2)
  f(@muladd(t+c2*dt),tmp,k3)
  tmp .= @muladd uprev+dt*(a41*k1+a42*k2+a43*k3)
  f(@muladd(t+c3*dt),tmp,k4)
  tmp .= @muladd uprev+dt*(a51*k1+a52*k2+a53*k3+a54*k4)
  f(@muladd(t+c4*dt),tmp,k5)
  tmp .= @muladd uprev+dt*(a61*k1+a62*k2+a63*k3+a64*k4+a65*k5)
  f(t+dt,tmp,k6)
  u .= @muladd uprev+dt*(a71*k1+a72*k2+a73*k3+a74*k4+a75*k5+a76*k6)
  f(t+dt,u,k7)
  if integrator.opts.adaptive
    utilde .= @muladd uprev + dt*(b1*k1 + b2*k2 + b3*k3 + b4*k4 + b5*k5 + b6*k6 + b7*k7)
    atmp .= ((utilde.-u)./@muladd(integrator.opts.abstol+max.(abs.(uprev),abs.(u)).*integrator.opts.reltol))
    integrator.EEst = integrator.opts.internalnorm(atmp)
  end
  @pack integrator = t,dt,u,k
end"><pre class="notranslate"><span class="pl-k">function</span> <span class="pl-en">perform_step!</span>(integrator,cache<span class="pl-k">::</span><span class="pl-c1">Tsit5Cache</span>,f<span class="pl-k">=</span>integrator<span class="pl-k">.</span>f)
  <span class="pl-c1">@unpack</span> t,dt,uprev,u,k <span class="pl-k">=</span> integrator
  <span class="pl-c1">@unpack</span> c1,c2,c3,c4,c5,c6,a21,a31,a32,a41,a42,a43,a51,a52,a53,a54,a61,a62,a63,a64,a65,a71,a72,a73,a74,a75,a76,b1,b2,b3,b4,b5,b6,b7 <span class="pl-k">=</span> cache<span class="pl-k">.</span>tab
  <span class="pl-c1">@unpack</span> k1,k2,k3,k4,k5,k6,k7,utilde,tmp,atmp <span class="pl-k">=</span> cache
  a <span class="pl-k">=</span> dt<span class="pl-k">*</span>a21
  tmp <span class="pl-k">.=</span> <span class="pl-c1">@muladd</span> uprev<span class="pl-k">+</span>a<span class="pl-k">*</span>k1
  <span class="pl-c1">f</span>(<span class="pl-c1">@muladd</span>(t<span class="pl-k">+</span>c1<span class="pl-k">*</span>dt),tmp,k2)
  tmp <span class="pl-k">.=</span> <span class="pl-c1">@muladd</span> uprev<span class="pl-k">+</span>dt<span class="pl-k">*</span>(a31<span class="pl-k">*</span>k1<span class="pl-k">+</span>a32<span class="pl-k">*</span>k2)
  <span class="pl-c1">f</span>(<span class="pl-c1">@muladd</span>(t<span class="pl-k">+</span>c2<span class="pl-k">*</span>dt),tmp,k3)
  tmp <span class="pl-k">.=</span> <span class="pl-c1">@muladd</span> uprev<span class="pl-k">+</span>dt<span class="pl-k">*</span>(a41<span class="pl-k">*</span>k1<span class="pl-k">+</span>a42<span class="pl-k">*</span>k2<span class="pl-k">+</span>a43<span class="pl-k">*</span>k3)
  <span class="pl-c1">f</span>(<span class="pl-c1">@muladd</span>(t<span class="pl-k">+</span>c3<span class="pl-k">*</span>dt),tmp,k4)
  tmp <span class="pl-k">.=</span> <span class="pl-c1">@muladd</span> uprev<span class="pl-k">+</span>dt<span class="pl-k">*</span>(a51<span class="pl-k">*</span>k1<span class="pl-k">+</span>a52<span class="pl-k">*</span>k2<span class="pl-k">+</span>a53<span class="pl-k">*</span>k3<span class="pl-k">+</span>a54<span class="pl-k">*</span>k4)
  <span class="pl-c1">f</span>(<span class="pl-c1">@muladd</span>(t<span class="pl-k">+</span>c4<span class="pl-k">*</span>dt),tmp,k5)
  tmp <span class="pl-k">.=</span> <span class="pl-c1">@muladd</span> uprev<span class="pl-k">+</span>dt<span class="pl-k">*</span>(a61<span class="pl-k">*</span>k1<span class="pl-k">+</span>a62<span class="pl-k">*</span>k2<span class="pl-k">+</span>a63<span class="pl-k">*</span>k3<span class="pl-k">+</span>a64<span class="pl-k">*</span>k4<span class="pl-k">+</span>a65<span class="pl-k">*</span>k5)
  <span class="pl-c1">f</span>(t<span class="pl-k">+</span>dt,tmp,k6)
  u <span class="pl-k">.=</span> <span class="pl-c1">@muladd</span> uprev<span class="pl-k">+</span>dt<span class="pl-k">*</span>(a71<span class="pl-k">*</span>k1<span class="pl-k">+</span>a72<span class="pl-k">*</span>k2<span class="pl-k">+</span>a73<span class="pl-k">*</span>k3<span class="pl-k">+</span>a74<span class="pl-k">*</span>k4<span class="pl-k">+</span>a75<span class="pl-k">*</span>k5<span class="pl-k">+</span>a76<span class="pl-k">*</span>k6)
  <span class="pl-c1">f</span>(t<span class="pl-k">+</span>dt,u,k7)
  <span class="pl-k">if</span> integrator<span class="pl-k">.</span>opts<span class="pl-k">.</span>adaptive
    utilde <span class="pl-k">.=</span> <span class="pl-c1">@muladd</span> uprev <span class="pl-k">+</span> dt<span class="pl-k">*</span>(b1<span class="pl-k">*</span>k1 <span class="pl-k">+</span> b2<span class="pl-k">*</span>k2 <span class="pl-k">+</span> b3<span class="pl-k">*</span>k3 <span class="pl-k">+</span> b4<span class="pl-k">*</span>k4 <span class="pl-k">+</span> b5<span class="pl-k">*</span>k5 <span class="pl-k">+</span> b6<span class="pl-k">*</span>k6 <span class="pl-k">+</span> b7<span class="pl-k">*</span>k7)
    atmp <span class="pl-k">.=</span> ((utilde<span class="pl-k">.-</span>u)<span class="pl-k">.</span><span class="pl-k">/</span><span class="pl-c1">@muladd</span>(integrator<span class="pl-k">.</span>opts<span class="pl-k">.</span>abstol<span class="pl-k">+</span><span class="pl-c1">max</span>.(<span class="pl-c1">abs</span>.(uprev),<span class="pl-c1">abs</span>.(u))<span class="pl-k">.*</span>integrator<span class="pl-k">.</span>opts<span class="pl-k">.</span>reltol))
    integrator<span class="pl-k">.</span>EEst <span class="pl-k">=</span> integrator<span class="pl-k">.</span>opts<span class="pl-k">.</span><span class="pl-c1">internalnorm</span>(atmp)
  <span class="pl-k">end</span>
  <span class="pl-c1">@pack</span> integrator <span class="pl-k">=</span> t,dt,u,k
<span class="pl-k">end</span></pre></div>
<p dir="auto">I.e. all that's changed are loops to broadcast. The input array is <code class="notranslate">y0</code> which is length 2. For reference, the <code class="notranslate">@muladd</code> macro acts like:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="println(macroexpand(:(u .= @muladd uprev+dt*(a71*k1+a72*k2+a73*k3+a74*k4+a75*k5+a76*k6))))
#u .= (muladd).(dt, (muladd).(a71, k1, (muladd).(a72, k2, (muladd).(a73, k3, (muladd).(a74, k4, (muladd).(a75, k5, a76 .* k6))))), uprev)

println(macroexpand(:(atmp .= ((utilde.-u)./@muladd(integrator.opts.abstol+max.(abs.(uprev),abs.(u)).*integrator.opts.reltol)))))
#atmp .= (utilde .- u) ./ (muladd).(max.(abs.(uprev), abs.(u)), integrator.opts.reltol, integrator.opts.abstol)"><pre lang="juila" class="notranslate"><code class="notranslate">println(macroexpand(:(u .= @muladd uprev+dt*(a71*k1+a72*k2+a73*k3+a74*k4+a75*k5+a76*k6))))
#u .= (muladd).(dt, (muladd).(a71, k1, (muladd).(a72, k2, (muladd).(a73, k3, (muladd).(a74, k4, (muladd).(a75, k5, a76 .* k6))))), uprev)

println(macroexpand(:(atmp .= ((utilde.-u)./@muladd(integrator.opts.abstol+max.(abs.(uprev),abs.(u)).*integrator.opts.reltol)))))
#atmp .= (utilde .- u) ./ (muladd).(max.(abs.(uprev), abs.(u)), integrator.opts.reltol, integrator.opts.abstol)
</code></pre></div>
<p dir="auto">The profile is here: <a href="https://ufile.io/2lu0f" rel="nofollow">https://ufile.io/2lu0f</a></p>
<p dir="auto">The benchmark results are using loops:</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="BenchmarkTools.Trial:
  memory estimate:  87.43 KiB
  allocs estimate:  3757
  --------------
  minimum time:     281.032 μs (0.00% GC)
  median time:      526.934 μs (0.00% GC)
  mean time:        475.180 μs (2.88% GC)
  maximum time:     5.601 ms (87.13% GC)
  --------------
  samples:          10000
  evals/sample:     1"><pre class="notranslate">BenchmarkTools<span class="pl-k">.</span>Trial<span class="pl-k">:</span>
  memory estimate<span class="pl-k">:</span>  <span class="pl-c1">87.43</span> KiB
  allocs estimate<span class="pl-k">:</span>  <span class="pl-c1">3757</span>
  <span class="pl-k">--------------</span>
  minimum time<span class="pl-k">:</span>     <span class="pl-c1">281.032</span> μs (<span class="pl-c1">0.00</span><span class="pl-k">%</span> GC)
  median time<span class="pl-k">:</span>      <span class="pl-c1">526.934</span> μs (<span class="pl-c1">0.00</span><span class="pl-k">%</span> GC)
  mean time<span class="pl-k">:</span>        <span class="pl-c1">475.180</span> μs (<span class="pl-c1">2.88</span><span class="pl-k">%</span> GC)
  maximum time<span class="pl-k">:</span>     <span class="pl-c1">5.601</span> ms (<span class="pl-c1">87.13</span><span class="pl-k">%</span> GC)
  <span class="pl-k">--------------</span>
  samples<span class="pl-k">:</span>          <span class="pl-c1">10000</span>
  evals<span class="pl-k">/</span>sample<span class="pl-k">:</span>     <span class="pl-c1">1</span></pre></div>
<p dir="auto">and using broadcast:</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="BenchmarkTools.Trial:
  memory estimate:  854.34 KiB
  allocs estimate:  37976
  --------------
  minimum time:     3.246 ms (0.00% GC)
  median time:      6.185 ms (0.00% GC)
  mean time:        5.762 ms (2.40% GC)
  maximum time:     13.919 ms (26.41% GC)
  --------------
  samples:          867
  evals/sample:     1"><pre class="notranslate">BenchmarkTools<span class="pl-k">.</span>Trial<span class="pl-k">:</span>
  memory estimate<span class="pl-k">:</span>  <span class="pl-c1">854.34</span> KiB
  allocs estimate<span class="pl-k">:</span>  <span class="pl-c1">37976</span>
  <span class="pl-k">--------------</span>
  minimum time<span class="pl-k">:</span>     <span class="pl-c1">3.246</span> ms (<span class="pl-c1">0.00</span><span class="pl-k">%</span> GC)
  median time<span class="pl-k">:</span>      <span class="pl-c1">6.185</span> ms (<span class="pl-c1">0.00</span><span class="pl-k">%</span> GC)
  mean time<span class="pl-k">:</span>        <span class="pl-c1">5.762</span> ms (<span class="pl-c1">2.40</span><span class="pl-k">%</span> GC)
  maximum time<span class="pl-k">:</span>     <span class="pl-c1">13.919</span> ms (<span class="pl-c1">26.41</span><span class="pl-k">%</span> GC)
  <span class="pl-k">--------------</span>
  samples<span class="pl-k">:</span>          <span class="pl-c1">867</span>
  evals<span class="pl-k">/</span>sample<span class="pl-k">:</span>     <span class="pl-c1">1</span></pre></div>
<p dir="auto">Am I hitting some broadcasting splatting penalty or something?</p>