<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 19, 2015 at 5:43 PM, Philip Reames <span dir="ltr"><<a href="mailto:listmail@philipreames.com" target="_blank">listmail@philipreames.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000"><span class="">
    <br>
    <div>On 01/12/2015 07:39 PM, Xinliang David
      Li wrote:<br>
    </div>
    </span><blockquote type="cite">
      <div dir="ltr"><br>
        <div class="gmail_extra"><br>
          <div class="gmail_quote"><span class="">On Wed, Jan 7, 2015 at 5:33 PM,
            Chandler Carruth <span dir="ltr"><<a href="mailto:chandlerc@google.com" target="_blank">chandlerc@google.com</a>></span>
            wrote:<br>
            </span><span class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div dir="ltr">
                <div class="gmail_extra"><br>
                  <div class="gmail_quote"><br>
                    <div>How does this compare with classical approaches
                      of loop peeling, partitioning, fission, or
                      whatever you might call it? Is there any
                      literature behind this approach or some literature
                      it should be compared with? (I genuinely don't
                      know this area that well, so I'm of little help
                      here...)</div>
                  </div>
                </div>
              </div>
            </blockquote>
            <div><br>
            </div>
            <div><br>
            </div>
            <div>It is not any of those loop transformations. It does
              not even change the control flow. It is more a code layout
              optimization -- move the cold trace in the loop out of the
              body.</div>
          </span></div>
        </div>
      </div>
    </blockquote>
    It's also a somewhat major change in the canonical form of the loop
    as seen by the optimizer.  That's probably the more important part
    in practice.  <br></div></blockquote><div><br></div><div>right. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000"><span class="">
    <blockquote type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">
            <div> <br>
            </div>
            <br>
            <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div dir="ltr">
                <div class="gmail_extra">
                  <div class="gmail_quote"><span>
                      <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                        <div bgcolor="#FFFFFF" text="#000000">
                          <div>
                            <div>
                              <ul>
                                <li>If so, is the notion of 'rareness'
                                  of a loop block something that's worth
                                  extracting out on it's own and
                                  reusing? Are there other similar uses
                                  anyone can think of?</li>
                                <li>Currently, I'm only supporting a
                                  fairly small set of controlling
                                  conditions. Are there important cases
                                  I'm not considering?</li>
                              </ul>
                            </div>
                          </div>
                        </div>
                      </blockquote>
                    </span>
                    <div>To both of these, I think the general
                      combination to use is to identify the set of
                      blocks dominated by a block which is in the loop
                      body of a hot loop, and is cold relative to the
                      other successors of its predecessor(s). These form
                      cold "regions" as I think of them without
                      requiring the complexity of the region analysis.</div>
                    <span>
                      <div> </div>
                    </span></div>
                </div>
              </div>
            </blockquote>
            <div><br>
            </div>
            <div>Static prediction should handle it  --  call heuristics
              or some combination with other heuristics (error handler
              recognition etc).</div>
            <div><br>
            </div>
          </div>
        </div>
      </div>
    </blockquote></span>
    Sorry, I'm really not sure what you're trying to say here.  Could
    you clarify/expand?  <br></div></blockquote><div><br></div><div>It is more of a comment about identify rare blocks -- there are cases where static heuristics can produce branch prediction with high confidence. <br></div><div><br></div><div>David</div></div><br></div></div>