[llvm-bugs] [Bug 26495] New: Inliner fails with negative threshholds

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Feb 5 09:42:45 PST 2016


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

            Bug ID: 26495
           Summary: Inliner fails with negative threshholds
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Interprocedural Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: hans at chromium.org
                CC: david.majnemer at gmail.com, eraman at google.com,
                    llvm-bugs at lists.llvm.org
    Classification: Unclassified

David reported on IRC the other week that we fail to inline g into f and f into
h here:


target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-windows-msvc"

define void @h(i8* nocapture readnone %this) {
entry:
  call void @f(i8* %this)
  unreachable
}

define linkonce_odr void @f(i8* nocapture readnone %this) {
entry:
  tail call void @g(i8* %this)
  unreachable
}

define linkonce_odr void @g(i8* nocapture readnone %this) {
entry:
  br label %for.cond

for.cond:
  tail call void @foo(i32 1)
  br label %for.cond
}

declare void @foo(i32)



$ bin/opt -inline /tmp/a.ll -S -debug
[..]
      Analyzing call of g...
      NumConstantArgs: 0
      NumConstantOffsetPtrArgs: 1
      NumAllocaArgs: 0
      NumConstantPtrCmps: 0
      NumConstantPtrDiffs: 0
      NumInstructionsSimplified: 1
      NumInstructions: 2
      SROACostSavings: 0
      SROACostSavingsLost: 0
      ContainsNoDuplicateCall: 0
      Cost: 30
      Threshold: -337
    NOT Inlining: cost=30, thres=-337, Call:   tail call void @g(i8* %this)
Inliner visiting SCC: h: 1 call sites.
      Analyzing call of f...
      NumConstantArgs: 0
      NumConstantOffsetPtrArgs: 1
      NumAllocaArgs: 0
      NumConstantPtrCmps: 0
      NumConstantPtrDiffs: 0
      NumInstructionsSimplified: 0
      NumInstructions: 1
      SROACostSavings: 0
      SROACostSavingsLost: 0
      ContainsNoDuplicateCall: 0
      Cost: 30
      Threshold: -337
    NOT Inlining: cost=30, thres=-337, Call:   call void @f(i8* %this)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160205/2cc70c16/attachment-0001.html>


More information about the llvm-bugs mailing list