<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 6/12/14, 11:41 AM, Chandler Carruth
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAGCO0Kiz_3dQ4gXpos2uoj54S-W7FjfZ9rY-oMCxaQ_gP1b2yg@mail.gmail.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div class="gmail_extra"><br>
          <div class="gmail_quote">On Thu, Jun 12, 2014 at 5:23 PM, John
            Criswell <span dir="ltr"><<a moz-do-not-send="true"
                href="mailto:criswell@illinois.edu" target="_blank">criswell@illinois.edu</a>></span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div class="">
                <div>On 6/12/14, 11:03 AM, Chandler Carruth wrote:<br>
                </div>
                <blockquote type="cite">
                  <div dir="ltr">
                    <div class="gmail_extra"><br>
                      <div class="gmail_quote">On Thu, Jun 12, 2014 at
                        4:45 PM, Hanbing Li <span dir="ltr"><<a
                            moz-do-not-send="true"
                            href="mailto:hanbing.li@inria.fr"
                            target="_blank">hanbing.li@inria.fr</a>></span>
                        wrote:<br>
                        <blockquote class="gmail_quote" style="margin:0
                          0 0 .8ex;border-left:1px #ccc
                          solid;padding-left:1ex">
                          <div>Hi,</div>
                          <div><br>
                          </div>
                          <div>I know when a pass needs other passes, it
                            will use something like this:
                            "AU.addRequired<LoopInfo>();". But
                            this is usually used for the analysis
                            passes.</div>
                          <div>When a pass needs another transform pass,
                            can it call it automatically?</div>
                          <div>For example:</div>
                          <div>Some loop optimizations may need
                            loop-simplify, I need add -loop-simplify
                            before calling these passes manually, or
                            they can call the pass -loop-simplify
                            automatically?</div>
                        </blockquote>
                      </div>
                      <br>
                      Currently, the pass manager allows you (somewhat)
                      to use the addRequired mechanism even with
                      analyses. However, I strongly encourage you to not
                      leverage it as it will eventually go away.</div>
                  </div>
                </blockquote>
                <br>
              </div>
              Just out of curiosity, why is this feature going away?</blockquote>
          </div>
          <br>
          Because it makes understanding the actual pass sequence
          horribly complex.</div>
        <div class="gmail_extra"><br>
        </div>
        <div class="gmail_extra">
          With analyses, things are simple. Whatever order you run the
          analyses in doesn't matter because they don't mutate anything.
          Each analysis can depend on other analyses and you either have
          a cycle (fast to detect and error on) or you have a DAG and
          there is a natural walk that produces the set of desired
          analyses.</div>
        <div class="gmail_extra"><br>
        </div>
        <div class="gmail_extra">Now consider when these passes are
          *transformations*. Now, the relative order in which you run
          them can dramatically change the results in unpredictable
          ways. There is no way for multiple "required" transformation
          passes to be ordered cleanly without a tremendous amount of
          machinery. All this is what led to LoopSimplify being run 4x
          as many times as was necessary for a long time. =/</div>
      </div>
    </blockquote>
    <br>
    If I understand what you're saying, you're keeping the current
    functionality of being able to schedule *analysis* passes using
    AU.addRequired<>() but removing the ability to schedule
    *transform* passes via AU.addRequired<>(), correct?<br>
    <br>
    Your original email implied that analysis passes would, in the
    future, not be scheduled via AU.addRequired<>().  I completely
    understand not scheduling transform passes that way.<br>
    <br>
    Regards,<br>
    <br>
    John Criswell<br>
    <br>
    <blockquote
cite="mid:CAGCO0Kiz_3dQ4gXpos2uoj54S-W7FjfZ9rY-oMCxaQ_gP1b2yg@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra"><br>
        </div>
        <div class="gmail_extra">Instead, everyone I've discussed this
          with (there have bene several email threads about this)
          prefers that there is a single place (the builder) which
          spells out the exact sequence of transforms applied.</div>
      </div>
    </blockquote>
    <br>
  </body>
</html>