diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp --- a/llvm/lib/Analysis/InlineCost.cpp +++ b/llvm/lib/Analysis/InlineCost.cpp @@ -978,6 +978,8 @@ if (F.getCallingConv() == CallingConv::Cold) Cost += InlineConstants::ColdccPenalty; + LLVM_DEBUG(dbgs() << " Initial cost: " << Cost << "\n"); + // Check if we're done. This can happen due to bonuses and penalties. if (Cost >= Threshold && !ComputeFullInlineCost) return InlineResult::failure("high cost"); diff --git a/llvm/test/Transforms/Inline/X86/extractvalue.ll b/llvm/test/Transforms/Inline/X86/extractvalue.ll --- a/llvm/test/Transforms/Inline/X86/extractvalue.ll +++ b/llvm/test/Transforms/Inline/X86/extractvalue.ll @@ -8,6 +8,7 @@ ; Check that extractvalue's are free. ; CHECK: Analyzing call of callee... (caller:caller_range) +; CHECK-NEXT: Initial cost: -35 ; CHECK-NEXT: define i32 @callee({ i32, i32 } %arg) { ; CHECK-NEXT: ; cost before = -35, cost after = -35, threshold before = 0, threshold after = 0, cost delta = 0 ; CHECK-NEXT: %r = extractvalue { i32, i32 } %arg, 0 diff --git a/llvm/test/Transforms/Inline/X86/insertvalue.ll b/llvm/test/Transforms/Inline/X86/insertvalue.ll --- a/llvm/test/Transforms/Inline/X86/insertvalue.ll +++ b/llvm/test/Transforms/Inline/X86/insertvalue.ll @@ -8,6 +8,7 @@ ; Check that insertvalue's aren't free. ; CHECK: Analyzing call of callee... (caller:caller_range) +; CHECK-NEXT: Initial cost: -40 ; CHECK-NEXT: define { i32, i32 } @callee({ i32, i32 } %arg, i32 %arg1) { ; CHECK-NEXT: ; cost before = -40, cost after = -35, threshold before = 0, threshold after = 0, cost delta = 5 ; CHECK-NEXT: %r = insertvalue { i32, i32 } %arg, i32 %arg1, 0