<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 7/16/15 1:39 PM, <a class="moz-txt-link-abbreviated" href="mailto:ed@modk.it">ed@modk.it</a> wrote:<br>
    </div>
    <blockquote
cite="mid:CAE1NinDj5j0yexK2+4CY9M8vUGpb2DqNdivYC8-Gt+NvQQzAxw@mail.gmail.com"
      type="cite">
      <meta http-equiv="Context-Type" content="text/html; charset=UTF-8">
      <div dir="ltr">Hi All,
        <div><br>
        </div>
        <div>After the initial learning curve, we're excited to have put
          together a completely gcc/binutils-free toolchain based on
          LLVM.  Now that we have things working, we desperately need to
          optimize the resulting binaries.  Our bin files are up to 10x
          their fully optimized gcc equivalent (1.5k vs 16k).  This is
          for a bare metal ARM based system so this is significant.</div>
        <div><br>
        </div>
        <div>We're using lld for linking and the following dead code
          elimination techniques seem to be dead ends:</div>
        <div><br>
        </div>
        <div>1) whole program optimization on our most egregious space
          waster (-fwhole-program not supported by clang)</div>
        <div>2) link time optimization (looks like this is only
          supported by lld for the COFF path not the ELF path)</div>
        <div>3) using a linker plugin like gold (-<span>fuse-linker-plugin
            doesn't seem to be supported by clang)</span></div>
        <div><br>
        </div>
        <div>We have control over the whole codebase and could
          essentially compile all of our C/C++ code as single file if
          there was a way to tell clang that it is seeing the whole
          program.</div>
        <div><br>
        </div>
        <div>Any thoughts on how we could achieve this?  This slidedeck
          suggests using llvm-link to accomplish this: <a moz-do-not-send="true" href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_devmtg_2013-2D11_slides_Gao-2DLTO.pdf&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=TLoIRs6M_cYUZSKAcynkcq55H57t5tpplD2x6T-b3mM&s=kZfwoBElwGePaEljcvFWBQ2n9bCYoAS2bojmIpl1-QE&e=">http://llvm.org/devmtg/2013-11/slides/Gao-LTO.pdf</a>. 
          Is this the most promising way forward?  <br>
        </div>
      </div>
    </blockquote>
    <br>
    Is there a reason why LLVM's link-time optimization won't work for
    you?<br>
    <br>
    <a class="moz-txt-link-freetext" href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_docs_GoldPlugin.html&d=AwMD-g&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=O4E9h_CRn7r-gjZC17qLtMFxvoXAbG0eykxVFaEDbsY&s=Rz0TGMGzPat1WM43SKOqw1RDfEB2bETMEai2l30CFKg&e=">http://llvm.org/docs/GoldPlugin.html</a><br>
    <a class="moz-txt-link-freetext" href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_docs_LinkTimeOptimization.html&d=AwMD-g&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=O4E9h_CRn7r-gjZC17qLtMFxvoXAbG0eykxVFaEDbsY&s=zlg4K8geNyY_qv0K6LS90AKIExyBv06d5xTqx_AieyE&e=">http://llvm.org/docs/LinkTimeOptimization.html</a><br>
    <br>
    Regards,<br>
    <br>
    John Criswell<br>
    <br>
    <blockquote
cite="mid:CAE1NinDj5j0yexK2+4CY9M8vUGpb2DqNdivYC8-Gt+NvQQzAxw@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div><br>
        </div>
        <div>Thanks,</div>
        <div>Ed</div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a class="moz-txt-link-freetext" href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
</pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
<a class="moz-txt-link-freetext" href="https://urldefense.proofpoint.com/v2/url?u=http-3A__www.cs.rochester.edu_u_criswell&d=AwMD-g&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=O4E9h_CRn7r-gjZC17qLtMFxvoXAbG0eykxVFaEDbsY&s=91rXuhhcWnwzzhIA9cdf9l7YhTeZMOklcE1UxulI4uQ&e=">http://www.cs.rochester.edu/u/criswell</a></pre>
  </body>
</html>