<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 - [NewPM] Inliner: Certain destructor calls are no longer inlined, preventing SROA, causing +10% runtime perf regression"
   href="https://bugs.llvm.org/show_bug.cgi?id=50099">50099</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[NewPM] Inliner: Certain destructor calls are no longer inlined, preventing SROA, causing +10% runtime perf regression
          </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>Interprocedural Analyses
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>lebedev.ri@gmail.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=24799" name="attach_24799" title="unoptimized IR for reproduction">attachment 24799</a> <a href="attachment.cgi?id=24799&action=edit" title="unoptimized IR for reproduction">[details]</a></span>
unoptimized IR for reproduction

I'm seeing a rather big +10% runtime perf regression
from new-pm switch on a certain codepath.

I don't really have a small workable testcase yet, 
but there's a full self-contained reproducer attached.

Here's how we can see that the problem is there:

$ clang -O3 -o old.ll -S -emit-llvm orig.ll -flegacy-pass-manager
$ clang -O3 -o new.ll -S -emit-llvm orig.ll 
$ llvm-diff old.ll new.ll
<...>
function @_ZN8rawspeed6BufferD2Ev exists only in right module
<...>
in function _ZN8rawspeed23PanasonicDecompressorV511ProxyStream10parseBlockEv:
  in block %entry:
    >   %FirstSection = alloca %"class.rawspeed::Buffer", align 8
    >   %SecondSection = alloca %"class.rawspeed::Buffer", align 8
    >   %0 = bitcast %"class.rawspeed::Buffer"* %FirstSection to i8*
    >   call void @llvm.lifetime.start.p0i8(i64 16, i8* nonnull %0) #17
    >   tail call void @llvm.experimental.noalias.scope.decl(metadata !135)
        %pos.i = getelementptr inbounds
%"class.rawspeed::PanasonicDecompressorV5::ProxyStream",
%"class.rawspeed::PanasonicDecompressorV5::ProxyStream"* %this, i64 0, i32 0,
i32 1
        %0 = load i32, i32* %pos.i, align 4, !tbaa !4, !noalias !9
    >   tail call void @llvm.experimental.noalias.scope.decl(metadata !138)

<...>

Inliner/inline cost model isn't something i'm familiar with,
so i'm posting this as is. Any suggestions how this can be approached from the
LLVM side?</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>