<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <div class="moz-cite-prefix">On 8/22/13 1:52 PM, Nick Lewycky wrote:<br>
    </div>
    <blockquote
cite="mid:CADbEz-ipMH+YuPfA18tDDvg_kbj1P3QtzUaWdNfQc5-H0hjjBw@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>Sorry, I totally wasn't following this thread at all. I'm
          assuming the goal is to clean up the flags in preparation of
          adding more smarts to the "we're doing LTO" case?</div>
      </div>
    </blockquote>
    80% correct.<br>
    <br>
    Let us use examples to clarify the goal:<br>
    <br>
     command 1:  clang -flto a.c -c<br>
     command 2:  clang -emit-llvm a.c -c  <br>
     command 3:  clang -emit-llvm a.c<br>
     command 4:  clang -O4 a.c -c<br>
    <br>
    The interpretation of these commands WAS:<br>
       command 1, 2: go through the passes defined in
    populateModulePasses(), and emit a *.bc file.<br>
       command 3, 4: compile to a.out using LTO<br>
       <br>
    <br>
     The interpretation of these commands will be:<br>
       command 1: need to indicate we are preparing for LTO <br>
       command 2: need to indicate we are *NOT* preparing for LTO<br>
       command 3: *meaningless*<br>
       command 4: unchanged. <br>
    <br>
    <blockquote
cite="mid:CADbEz-ipMH+YuPfA18tDDvg_kbj1P3QtzUaWdNfQc5-H0hjjBw@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div><br>
        </div>
        On 22 August 2013 13:10, Eric Christopher <span dir="ltr"><<a
            moz-do-not-send="true" href="mailto:echristo@gmail.com"
            target="_blank">echristo@gmail.com</a>></span> wrote:<br>
        <div class="gmail_extra">
          <div class="gmail_quote">
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div class="im">On Thu, Aug 22, 2013 at 12:53 PM, Eric
                Christopher <<a moz-do-not-send="true"
                  href="mailto:echristo@gmail.com">echristo@gmail.com</a>>
                wrote:<br>
                > On Thu, Aug 22, 2013 at 12:14 PM, Rafael Espíndola<br>
                > <<a moz-do-not-send="true"
                  href="mailto:rafael.espindola@gmail.com">rafael.espindola@gmail.com</a>>
                wrote:<br>
                >>> Right. My comment on this change is, in
                essence, that people have<br>
                >>> depended upon the fact that -flto does what
                you want -emit-llvm to do<br>
                >>> for that compile line for a while. I don't
                think it's necessarily<br>
                >>> right, but that you're going to be breaking
                current use.<br>
                >><br>
                >> So, the possible changes that people using
                clang will have to adapt to is<br>
                >><br>
                >> 1) Using -flto instead of -emit-llvm when doing
                an lto build.<br>
                >> 2) Using -emit-llvm instead of -flto when
                fetching IL to be passed to<br>
                >> bugpoint or similar.<br>
                >><br>
                >> I don't think 2 is a big concern, since it is a
                dev option and we<br>
                >> change those as needed. Issue 1 is a bit more
                serious, but the change<br>
                >> is really simple. The -flto option is also what
                gcc uses.<br>
                >><br>
                ><br>
                > The concerns I've seen are that -emit-llvm doesn't
                work as well as<br>
                > -flto for the task of grabbing IR for any purpose.
                Nick is the one who<br>
                > brought this up within hearing range the other day,
                maybe he can<br>
                > explain. FWIW I only think -flto should be used to
                enable lto mode of<br>
                > everything on the command line and not for grabbing
                IR at all. I.e. if<br>
                > there's no link step then -flto shouldn't do
                anything.<br>
              </div>
            </blockquote>
            <div><br>
            </div>
            <div>:)</div>
            <div><br>
            </div>
            <div>As Eric suggested, I was surprised to discover we have
              a -emit-llvm flag, then more surprised that it didn't
              bother to pass the right linker flags when linking. I
              think I called it "a broken copy of -flto", arguing that
              we should delete it entirely, in favour of -flto.</div>
            <div><br>
            </div>
            <div>As for telling the compiler "I want to build with LTO",
              we already have -O4 which is presently equivalent to -O3
              -flto. Let's keep that? </div>
          </div>
        </div>
      </div>
    </blockquote>
    Of course!<br>
    <br>
      "-O4" thing is immaterial here:-). <br>
    <br>
    <blockquote
cite="mid:CADbEz-ipMH+YuPfA18tDDvg_kbj1P3QtzUaWdNfQc5-H0hjjBw@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">
            <div>In the future, -O4 should select the pre-IPO
              optimizations. (I would also like a "-Olto" flag
              specifically so that I can select the pre-IPO optimization
              stack, even if I'm generating native code directly, for
              debugging and benchmarking and also to keep separate the
              concerns of selecting an optz'n stack and selecting the
              output format.)</div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    <br>
    <blockquote
cite="mid:CADbEz-ipMH+YuPfA18tDDvg_kbj1P3QtzUaWdNfQc5-H0hjjBw@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">
            <div><br>
            </div>
            <div>I won't block a patch that changes/removes -flto, but
              my fingers will still be typing it for years to come. I
              don't want it, but I could live with it.</div>
            <div><br>
            </div>
            <br>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>