[PATCH] D108587: [MLGO] Make sure inliner logs when deleting callees
Mircea Trofin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 23 14:54:59 PDT 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG1055c5e1d316: [MLGO] Make sure inliner logs when deleting callees (authored by mtrofin).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D108587/new/
https://reviews.llvm.org/D108587
Files:
llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp
llvm/test/Transforms/Inline/ML/dev-mode-log-deleted.ll
Index: llvm/test/Transforms/Inline/ML/dev-mode-log-deleted.ll
===================================================================
--- /dev/null
+++ llvm/test/Transforms/Inline/ML/dev-mode-log-deleted.ll
@@ -0,0 +1,32 @@
+; REQUIRES: have_tf_api
+; RUN: opt -enable-ml-inliner=development -passes=scc-oz-module-inliner \
+; RUN: -training-log=- -tfutils-text-log -S < %s | FileCheck %s
+
+define i32 @top() {
+ %a = call i32 @to_be_deleted()
+ %b = call i32 @externally_visible()
+ %ret = add i32 %a, %b
+ ret i32 %ret
+}
+
+define internal i32 @to_be_deleted() {
+ ret i32 1
+}
+
+define i32 @externally_visible() {
+ ret i32 2
+}
+
+; CHECK: key: "inlining_decision"
+; CHECK-NEXT: value {
+; CHECK-NEXT: feature {
+; CHECK-NEXT: int64_list {
+; CHECK-NEXT: value: 1
+; CHECK-NEXT: }
+; CHECK-NEXT: }
+; CHECK-NEXT: feature {
+; CHECK-NEXT: int64_list {
+; CHECK-NEXT: value: 1
+; CHECK-NEXT: }
+; CHECK-NEXT: }
+; CHECK-NEXT: }
\ No newline at end of file
Index: llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp
===================================================================
--- llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp
+++ llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp
@@ -227,6 +227,8 @@
(*CallerSizeEstimateBefore + *CalleeSizeEstimateBefore);
getAdvisor()->updateNativeSizeEstimate(Reward);
log(Reward, /*Success=*/true);
+ } else {
+ log(NoReward, /*Success=*/true);
}
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108587.368215.patch
Type: text/x-patch
Size: 1543 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210823/6105ed2a/attachment.bin>
More information about the llvm-commits
mailing list