<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 - [CodeGenPrepare] Unreported IR changes in OptimizeExtractBits"
   href="https://bugs.llvm.org/show_bug.cgi?id=47503">47503</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[CodeGenPrepare] Unreported IR changes in OptimizeExtractBits
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </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>Common Code Generator Code
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>dmajor@mozilla.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=23950" name="attach_23950" title="OptimizeExtractBits.ll">attachment 23950</a> <a href="attachment.cgi?id=23950&action=edit" title="OptimizeExtractBits.ll">[details]</a></span>
OptimizeExtractBits.ll

With expensive checks enabled:
opt -codegenprepare -S OptimizeExtractBits.ll
Pass modifies its input and doesn't report it: CodeGen Prepare

The reproducer is not quite as reduced as it could be, but I need to get to a
stopping point for the week.

The `MadeChange =` should be `MadeChange |=` at
<a href="https://github.com/llvm/llvm-project/blob/06e356c81e0fce90c9a21f9f5fb7567efa51ee0f/llvm/lib/CodeGen/CodeGenPrepare.cpp#L1847">https://github.com/llvm/llvm-project/blob/06e356c81e0fce90c9a21f9f5fb7567efa51ee0f/llvm/lib/CodeGen/CodeGenPrepare.cpp#L1847</a>

This apparently dates back to LLVM 3.5:
<a href="https://github.com/llvm/llvm-project/commit/d069f6393a7c">https://github.com/llvm/llvm-project/commit/d069f6393a7c</a>

I haven't tested, but by inspection, this other use of `MadeChange =` also
looks suspicious:
<a href="https://github.com/llvm/llvm-project/blob/06e356c81e0fce90c9a21f9f5fb7567efa51ee0f/llvm/lib/CodeGen/CodeGenPrepare.cpp#L1153">https://github.com/llvm/llvm-project/blob/06e356c81e0fce90c9a21f9f5fb7567efa51ee0f/llvm/lib/CodeGen/CodeGenPrepare.cpp#L1153</a></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>