<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Assertion `(LocalChanged || (RefHash == StructuralHash(F))) && "Pass modifies its input and doesn't report it."' for -loop-idiom pass"
   href="https://bugs.llvm.org/show_bug.cgi?id=46745">46745</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion `(LocalChanged || (RefHash == StructuralHash(F))) && "Pass modifies its input and doesn't report it."' for -loop-idiom pass
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>david.stenberg@ericsson.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org, sguelton@redhat.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=23728" name="attach_23728" title="IR reproducer.">attachment 23728</a> <a href="attachment.cgi?id=23728&action=edit" title="IR reproducer.">[details]</a></span>
IR reproducer.

LLVM commit: 274332282cb4ce167de8e73fb9c59d2eecd67c25

Requires an expensive checks build to reproduce.

$ opt -loop-idiom -disable-basic-aa -S loop-idiom.ll
opt: ../lib/IR/LegacyPassManager.cpp:1591: bool
llvm::FPPassManager::runOnFunction(llvm::Function &): Assertion `(LocalChanged
|| (RefHash == StructuralHash(F))) && "Pass modifies its input and doesn't
report it."' failed.

After some very shallow troubleshooting, the issue seems to be that we return
false in this case:

  if (mayLoopAccessLocation(BasePtr, ModRefInfo::ModRef, CurLoop, BECount,      
                            StoreSize, *AA, Stores)) {                          
    Expander.clear();                                                           
    // If we generated new code for the base pointer, clean up.                 
    RecursivelyDeleteTriviallyDeadInstructions(BasePtr, TLI);                   
    return false;                                                               
  }</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>