<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 - GuardWidening creates extra instructions during analysis and does not clean up"
   href="https://bugs.llvm.org/show_bug.cgi?id=33497">33497</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>GuardWidening creates extra instructions during analysis and does not clean up
          </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>Linux
          </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>Scalar Optimizations
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>listmail@philipreames.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I noticed when analysing an inlining problem that the guard widening pass is
creating additional instructions and not removing them.  The net effect is that
guard widening adds instructions when run even if the transform doesn't
trigger.  If it does trigger, then we leave duplicate copies of the comparisons
in place.

The guilty function is widenCondCommon which is used both for analysis and
transform.

The extra IR generated is trivially dead and removable so most any other pass
will remove it, but we really shouldn't be relying on other passes for basic
cleanliness.  

You can see this behaviour by simply inspecting the output of the already in
tree test/Transforms/GuardWidening/range-check-merging.ll.  (Not the check
statements; the actual output.)</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>