<html>
<head>
<base href="https://llvm.org/bugs/" />
</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 --- - Infinite inlining of recursive functions"
href="https://llvm.org/bugs/show_bug.cgi?id=26371">26371</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Infinite inlining of recursive functions
</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>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Interprocedural Optimizations
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>apilipenko@azulsystems.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=15752" name="attach_15752" title="Reproducer">attachment 15752</a> <a href="attachment.cgi?id=15752&action=edit" title="Reproducer">[details]</a></span>
Reproducer
To prevent infinite inlining of recursive functions Inliner maintains
InlineHistory structure. However in some cases we might still end up inlining
recursive function chain. It happens when Inliner is executed in a CallGraphSCC
pass manager iteration. CGSCC pass manager spins one more iteration of inlining
if some indirect call site was devirtualized by other CGSCC passes. No
InlineHistory is maintained between these inliner iterations. Small reproducer
is in the attachment.
In practice it's rarely a problem because the number of iterations in CGSCC is
limited by 4 by default. But theoretically it can lead to an exponential growth
of code size.
The suggested fix is to mark recursive call sites encountered by Inliner with
NoInline attribute, so this information will be maintained between inlining
iterations.</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>