<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=koi8-r">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">My speculation here is that we
      originally didn't have the check for cycles and someone (maybe
      even the original author) added it to prevent stack overflow due
      to infinite recursion.š I do not see a strong reason not to handle
      phi cycles in this code.š Curious if anyone else disagrees?š Or
      was around for the design of this?<br>
      <br>
      Philip<br>
      <br>
      On 06/29/2017 08:47 PM, Serguei Katkov via llvm-dev wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:7522fb91799c481b9450902a4228ed79@azul.com">
      <meta http-equiv="Content-Type" content="text/html;
        charset=koi8-r">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:56.7pt 42.5pt 56.7pt 85.05pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal">Dear Community,<o:p></o:p></p>
        <p class="MsoNormal"><o:p>š</o:p></p>
        <p class="MsoNormal">I'm trying to implement optimization
          described in PR26223 and meet the following bail out condition
          in CodeGenPrepare::optimizeMemoryInst.<o:p></o:p></p>
        <p class="MsoNormal"><o:p>š</o:p></p>
        <p class="MsoNormal">ššš // Break use-def graph loops.<o:p></o:p></p>
        <p class="MsoNormal">ššš if (!Visited.insert(V).second) {<o:p></o:p></p>
        <p class="MsoNormal">ššššš Consensus = nullptr;<o:p></o:p></p>
        <p class="MsoNormal">ššššš break;<o:p></o:p></p>
        <p class="MsoNormal">ššš }<o:p></o:p></p>
        <p class="MsoNormal"><o:p>š</o:p></p>
        <p class="MsoNormal">So while traversing thorough phi nodes from
          memory instruction to find addr mode we bail out if we meet
          some instruction twice.<o:p></o:p></p>
        <p class="MsoNormal">Does anybody know/remember what is the
          reason for this checks.<o:p></o:p></p>
        <p class="MsoNormal">From the first glance it seems that it will
          be ok if we just mark it as visited and continue processing
          worklist.<o:p></o:p></p>
        <p class="MsoNormal">I did this change and make check passed. <o:p></o:p></p>
        <p class="MsoNormal"><o:p>š</o:p></p>
        <p class="MsoNormal">So I seek for a help to explain this
          decision.<o:p></o:p></p>
        <p class="MsoNormal"><o:p>š</o:p></p>
        <p class="MsoNormal">Thank you in advance,<o:p></o:p></p>
        <p class="MsoNormal">Serguei.<o:p></o:p></p>
        <p class="MsoNormal"><span lang="RU"><o:p>š</o:p></span></p>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
    </blockquote>
    <p><br>
    </p>
  </body>
</html>