<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:davide@freebsd.org" title="Davide Italiano <davide@freebsd.org>"> <span class="fn">Davide Italiano</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - -reassociate runs forever"
   href="https://bugs.llvm.org/show_bug.cgi?id=37390">bug 37390</a>
          <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>FIXED
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - -reassociate runs forever"
   href="https://bugs.llvm.org/show_bug.cgi?id=37390#c6">Comment # 6</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - -reassociate runs forever"
   href="https://bugs.llvm.org/show_bug.cgi?id=37390">bug 37390</a>
              from <span class="vcard"><a class="email" href="mailto:davide@freebsd.org" title="Davide Italiano <davide@freebsd.org>"> <span class="fn">Davide Italiano</span></a>
</span></b>
        <pre>dcci@Davides-MacBook-Pro ~/w/l/llvm> git svn dcommit --interactive
Committing to <a href="https://llvm.org/svn/llvm-project/llvm/trunk">https://llvm.org/svn/llvm-project/llvm/trunk</a> ...
commit 8c88b7846a8120179850d6ba485ae731aba20982
Author: Davide Italiano <<a href="mailto:ditaliano@apple.com">ditaliano@apple.com</a>>
Date:   Fri May 11 08:42:01 2018 -0700

    [Reassociate] Prevent infinite loops when processing PHIs.

    Phi nodes can reside in live blocks but one of their incoming
    arguments can come from a dead block. Dead blocks and reassociate
    don't play nice together. In fact, reassociate performs an RPO
    as a first step to avoid processing dead blocks.

    The reason why Reassociate might not fixpoint when examining
    dead blocks is that the following:

      %xor0 = xor i16 %xor1, undef
      %xor1 = xor i16 %xor0, undef

    is perfectly valid LLVM IR (if it appears in a dead block),
    so the worklist algorithm keeps pushing the two instructions for
    reexamination. Note that this is not Reassociate fault, at least
    not entirely. It's llvm that has a weird definition of dominance.

    Fixes PR37390.

 create mode 100644 test/Transforms/Reassociate/infloop-deadphi.ll
Commit this patch to SVN? ([y]es (default)|[n]o|[q]uit|[a]ll): y
        A       test/Transforms/Reassociate/infloop-deadphi.ll
        M       lib/Transforms/Scalar/Reassociate.cpp
Committed r332100
        M       lib/Target/AMDGPU/AMDGPUISelLowering.cpp
        A       test/CodeGen/AMDGPU/partial-shift-shrink.ll</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>