[PATCH] D127597: [InlineCost] Improve debugging experience by adding print about initial inlining cost
Dawid Jurczak via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 24 07:29:38 PDT 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGb7e7f4e1b6f9: [InlineCost] Improve debugging experience by adding print about initial… (authored by yurai007).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D127597/new/
https://reviews.llvm.org/D127597
Files:
llvm/lib/Analysis/InlineCost.cpp
llvm/test/Transforms/Inline/X86/extractvalue.ll
llvm/test/Transforms/Inline/X86/insertvalue.ll
Index: llvm/test/Transforms/Inline/X86/insertvalue.ll
===================================================================
--- llvm/test/Transforms/Inline/X86/insertvalue.ll
+++ 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
Index: llvm/test/Transforms/Inline/X86/extractvalue.ll
===================================================================
--- llvm/test/Transforms/Inline/X86/extractvalue.ll
+++ 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
Index: llvm/lib/Analysis/InlineCost.cpp
===================================================================
--- llvm/lib/Analysis/InlineCost.cpp
+++ llvm/lib/Analysis/InlineCost.cpp
@@ -982,6 +982,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");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127597.439749.patch
Type: text/x-patch
Size: 1778 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220624/49a3b104/attachment.bin>
More information about the llvm-commits
mailing list