<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:spatel+llvm@rotateright.com" title="Sanjay Patel <spatel+llvm@rotateright.com>"> <span class="fn">Sanjay Patel</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - static_cast<T*>(this) does not propagate non-null invariant of 'this'"
   href="https://bugs.llvm.org/show_bug.cgi?id=35909">bug 35909</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 - static_cast<T*>(this) does not propagate non-null invariant of 'this'"
   href="https://bugs.llvm.org/show_bug.cgi?id=35909#c8">Comment # 8</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - static_cast<T*>(this) does not propagate non-null invariant of 'this'"
   href="https://bugs.llvm.org/show_bug.cgi?id=35909">bug 35909</a>
              from <span class="vcard"><a class="email" href="mailto:spatel+llvm@rotateright.com" title="Sanjay Patel <spatel+llvm@rotateright.com>"> <span class="fn">Sanjay Patel</span></a>
</span></b>
        <pre>Should be fixed with:
<a href="https://reviews.llvm.org/rL322950">https://reviews.llvm.org/rL322950</a>

With that change, everything proceeds as before until after inlining. When we
run instcombine after that, we kill the null check because the GEP is now known
to be inbounds:

IC: Visiting:   %sub.ptr2.i = getelementptr inbounds %class.B, %class.B* %b,
i64 -1
IC: Visiting:   %1 = bitcast %class.B* %sub.ptr2.i to %class.A*
IC: Visiting:   %tobool1 = icmp eq %class.A* %1, null
IC: Replacing   %tobool1 = icmp eq %class.A* %1, null
    with i1 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>