<p dir="auto"><code class="notranslate">@code_native</code> appears to be a little broken on LLVM 3.7. The labels are all printed at the very beginning, which is <strong>not</strong> very helpful to figure out the control flow.....</p>
<div class="highlight highlight-source-assembly notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia&gt; function f(a)
           s = zero(eltype(a))
           @inbounds for i in 1:length(a)
               s += a[i]
           end
           s
       end
f (generic function with 1 method)

julia&gt; @code_native f(Int[])
L16:L29:        .text
        movq    8(%rdi), %rcx
        xorl    %eax, %eax
        testq   %rcx, %rcx
        jle     L29
        movq    (%rdi), %rdx
        xorl    %eax, %eax
        addq    (%rdx), %rax
        addq    $8, %rdx
        addq    $-1, %rcx
        jne     L16
        retq
        nop
        pushq   %rax
        movq    (%rsi), %rdi
        movabsq $f, %rax
        callq   *%rax
        movabsq $jl_box_int64, %rcx
        movq    %rax, %rdi
        callq   *%rcx
        popq    %rdx
        retq"><pre class="notranslate"><span class="pl-en">julia&gt; function f(a)</span>
<span class="pl-en">           s = zero(eltype(a))</span>
<span class="pl-en">           @inbounds for i </span><span class="pl-k">in</span><span class="pl-en"> </span><span class="pl-c1">1</span><span class="pl-en">:length(a)</span>
<span class="pl-en">               s </span><span class="pl-s1">+</span><span class="pl-en">= a</span><span class="pl-s1">[</span><span class="pl-en">i</span><span class="pl-s1">]</span>
<span class="pl-en">           end</span>
<span class="pl-en">           s</span>
<span class="pl-en">       end</span>
<span class="pl-en">f (generic function with </span><span class="pl-c1">1</span><span class="pl-en"> method)</span>

<span class="pl-en">julia&gt; @code_native f(</span><span class="pl-k">Int</span><span class="pl-s1">[]</span><span class="pl-en">)</span>
<span class="pl-en">L16:L29:        .text</span>
<span class="pl-en">        </span><span class="pl-k">movq</span><span class="pl-en">    </span><span class="pl-c1">8</span><span class="pl-en">(%</span><span class="pl-v">rdi</span><span class="pl-en">)</span><span class="pl-s1">,</span><span class="pl-en"> %</span><span class="pl-v">rcx</span>
<span class="pl-en">        xorl    %</span><span class="pl-v">eax</span><span class="pl-s1">,</span><span class="pl-en"> %</span><span class="pl-v">eax</span>
<span class="pl-en">        testq   %</span><span class="pl-v">rcx</span><span class="pl-s1">,</span><span class="pl-en"> %</span><span class="pl-v">rcx</span>
<span class="pl-en">        </span><span class="pl-k">jle</span><span class="pl-en">     L29</span>
<span class="pl-en">        </span><span class="pl-k">movq</span><span class="pl-en">    (%</span><span class="pl-v">rdi</span><span class="pl-en">)</span><span class="pl-s1">,</span><span class="pl-en"> %</span><span class="pl-v">rdx</span>
<span class="pl-en">        xorl    %</span><span class="pl-v">eax</span><span class="pl-s1">,</span><span class="pl-en"> %</span><span class="pl-v">eax</span>
<span class="pl-en">        addq    (%</span><span class="pl-v">rdx</span><span class="pl-en">)</span><span class="pl-s1">,</span><span class="pl-en"> %</span><span class="pl-v">rax</span>
<span class="pl-en">        addq</span>    <span class="pl-c1">$</span><span class="pl-c1">8</span><span class="pl-s1">,</span><span class="pl-en"> %</span><span class="pl-v">rdx</span>
<span class="pl-en">        addq    $</span><span class="pl-s1">-</span><span class="pl-c1">1</span><span class="pl-s1">,</span><span class="pl-en"> %</span><span class="pl-v">rcx</span>
<span class="pl-en">        </span><span class="pl-k">jne</span><span class="pl-en">     L16</span>
<span class="pl-en">        retq</span>
<span class="pl-en">        </span><span class="pl-k">nop</span>
<span class="pl-en">        pushq   %</span><span class="pl-v">rax</span>
<span class="pl-en">        </span><span class="pl-k">movq</span><span class="pl-en">    (%</span><span class="pl-v">rsi</span><span class="pl-en">)</span><span class="pl-s1">,</span><span class="pl-en"> %</span><span class="pl-v">rdi</span>
<span class="pl-en">        movabsq</span> <span class="pl-c1">$</span><span class="pl-en">f</span><span class="pl-s1">,</span><span class="pl-en"> %</span><span class="pl-v">rax</span>
<span class="pl-en">        callq   </span><span class="pl-s1">*</span><span class="pl-en">%</span><span class="pl-v">rax</span>
<span class="pl-en">        movabsq</span> <span class="pl-c1">$</span><span class="pl-en">jl_box_int64</span><span class="pl-s1">,</span><span class="pl-en"> %</span><span class="pl-v">rcx</span>
<span class="pl-en">        </span><span class="pl-k">movq</span><span class="pl-en">    %</span><span class="pl-v">rax</span><span class="pl-s1">,</span><span class="pl-en"> %</span><span class="pl-v">rdi</span>
<span class="pl-en">        callq   </span><span class="pl-s1">*</span><span class="pl-en">%</span><span class="pl-v">rcx</span>
<span class="pl-en">        popq    %</span><span class="pl-v">rdx</span>
<span class="pl-en">        retq</span></pre></div>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/vtjnash/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/vtjnash">@vtjnash</a> I remember you have a PR about <code class="notranslate">code_native</code>?<br>
Also <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Keno/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Keno">@Keno</a></p>
<p dir="auto">Edit: add missing <code class="notranslate">**not**</code></p>
<p dir="auto">ref <a class="commit-link" href="https://github.com/JuliaLang/julia/commit/b2e69d0d871b65e70175ae088c77cb39b1e9a020#commitcomment-12053593"><tt>b2e69d0</tt>#commitcomment-12053593</a> and <a href="https://github.com/JuliaLang/julia/pull/11852/files#r34115071">https://github.com/JuliaLang/julia/pull/11852/files#r34115071</a></p>