<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Hi Rui,<br>
      <br>
      ELF uses layout-after and in-group references now. It no longer
      uses layout-before.<br>
      <br>
      The reason that two references are used are to make sure garbage
      collection treats the whole group of atoms together when it wants
      to Garbage collect an atom.<br>
      <br>
      Thanks<br>
      <br>
      Shankar Easwaran<br>
      <br>
      On 3/21/2014 5:45 PM, Rui Ueyama wrote:<br>
    </div>
    <blockquote
cite="mid:CAJENXgs3g4m2bFh5Fx66qr82WjM15_mf-3=34nZd4eV=tgrLtw@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">+llvmdev<br>
          <br>
          <div class="gmail_quote">On Fri, Mar 21, 2014 at 3:43 PM, Rui
            Ueyama <span dir="ltr"><<a moz-do-not-send="true"
                href="mailto:ruiu@google.com" target="_blank">ruiu@google.com</a>></span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div dir="ltr">Hi all,
                <div><br>
                </div>
                <div>I'm trying to debug an issue that LLD sometimes get
                  into an infinite loop in setChainRoot() in
                  LayoutPass.cpp. It looks like the cause is either
                  buildPrecededByTable() handles layoutBefore edges in a
                  wrong way or we construct a contradictory
                  layout-before/layout-after graph.</div>
                <div><br>
                </div>
                <div>At this point I started thinking that I'm wasting
                  time on data structure that's more complicated than it
                  needs to be. LayoutPass.cpp is I think the most
                  complicated piece of code in our code base and is also
                  hard to debug. If we can simplify it we totally should
                  do.</div>
                <div><br>
                </div>
                <div>So, I'm planning to remove one of layout-before or
                  layout-after edges from the graph. Currently, in LLD,
                  if node X has an outgoing layout-before edge to Y, Y
                  always has an outgoing layout-after edge to X. In
                  other words it's doubly-linked. Doubly-linked edge is
                  useful if you need bi-directional access, however, we
                  don't need it in LayoutPass. We only need one of two.</div>
                <div><br>
                </div>
                <div>Removing one of layout-before/layout-after edges
                  has three benefits:</div>
                <div><br>
                </div>
                <div> 1. Reduces memory usage and runtime overhead</div>
                <div> 2. Simpler code and algorithm</div>
                <div> 3. No need to maintain consistency between
                  layout-before/layout-after edges, which is often a
                  cause of nasty bugs.</div>
                <div><br>
                </div>
                <div>Does this sound good?</div>
              </div>
            </blockquote>
          </div>
          <br>
        </div>
      </div>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation</pre>
  </body>
</html>