https://llvm.org/bugs/show_bug.cgi?id=24851

            Bug ID: 24851
           Summary: -inline will not inline a trivial function containing
                    only unreachable
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Interprocedural Optimizations
          Assignee: unassignedb...@nondot.org
          Reporter: david.majne...@gmail.com
                CC: llvm-bugs@lists.llvm.org
    Classification: Unclassified

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
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to