<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Sep 26, 2011, at 10:36 AM, Carlo Alberto Ferraris wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
  

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  
  <div bgcolor="#FFFFFF" text="#000000">
    Il 26/09/2011 16:49, Jakob Stoklund Olesen ha scritto:
    <blockquote class=" cite" id="mid_332679F7-8186-49CF-AD27-F240DD375B08_2pi_dk" cite="mid:332679F7-8186-49CF-AD27-F240DD375B08@2pi.dk" type="cite">
      <pre wrap="">On Sep 26, 2011, at 2:41 AM, 陳韋任 wrote:

</pre>
      <blockquote class=" cite" id="Cite_5" type="cite">
        <blockquote class=" cite" id="Cite_6" type="cite">
          <pre wrap="">The greedy allocator is global, but so was the old linear scan allocator.
</pre>
        </blockquote>
        <pre wrap=""> In <a class="moz-txt-link-freetext" href="http://blog.llvm.org/2011/09/greedy-register-allocation-in-llvm-30.html">http://blog.llvm.org/2011/09/greedy-register-allocation-in-llvm-30.html</a>
, it says "The algorithm is local, and it cannot clean up messes that
extend beyond a single basic block". Does it mean the rewriter algorithm
not the linear scan?
</pre>
      </blockquote>
      <pre wrap="">Yes, exactly.  The rewriter is local.
</pre>
    </blockquote>
    So, does this mean that different BBs may expect the same spilled
    value to be in different stack slots?<br></div></blockquote><div><br></div><div>No, the stack slot is assigned before a live range is spilled, so it uses the same stack slot everywhere. The rewriter is mostly eliminating multiple loads from the same stack slot in a basic block.</div><div><br></div><div>But that was the old complicated rewriter. The new rewriter used by greedy is completely trivial. It doesn't know anything about stack slots. It has only one optimization: Eliminate identity copies.</div><div><br></div><div>/jakob</div><div><br></div></div></body></html>