<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 --- - -inline will not inline a trivial function containing only unreachable"
   href="https://llvm.org/bugs/show_bug.cgi?id=24851">24851</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>-inline will not inline a trivial function containing only unreachable
          </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>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>david.majnemer@gmail.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>consider:
$ cat t.ll
define void @f() {
entry:
  tail call void @g()
  unreachable
}

define void @g() {
entry:
  unreachable
}

$ opt -inline t.ll -S -debug
Inliner visiting SCC: g: 0 call sites.
Inliner visiting SCC: f: 1 call sites.
      Analyzing call of g...
      NumConstantArgs: 0
      NumConstantOffsetPtrArgs: 0
      NumAllocaArgs: 0
      NumConstantPtrCmps: 0
      NumConstantPtrDiffs: 0
      NumInstructionsSimplified: 1
      NumInstructions: 1
      SROACostSavings: 0
      SROACostSavingsLost: 0
      ContainsNoDuplicateCall: 0
      Cost: 0
      Threshold: -337
    NOT Inlining: cost=0, thres=-337, Call:   tail call void @g()
Inliner visiting SCC: INDIRECTNODE: 0 call sites.
; ModuleID = 't.ll'

define void @f() {
entry:
  tail call void @g()
  unreachable
}

define void @g() {
entry:
  unreachable
}</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>