forked from OSchip/llvm-project
[MLGO] Make sure inliner logs when deleting callees
When using final reward (which is now the default), we were skipping logging decisions that were leading to callee deletion. This fixes that. Differential Revision: https://reviews.llvm.org/D108587
This commit is contained in:
parent
d898693f72
commit
1055c5e1d3
|
@ -227,6 +227,8 @@ private:
|
|||
(*CallerSizeEstimateBefore + *CalleeSizeEstimateBefore);
|
||||
getAdvisor()->updateNativeSizeEstimate(Reward);
|
||||
log(Reward, /*Success=*/true);
|
||||
} else {
|
||||
log(NoReward, /*Success=*/true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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: }
|
Loading…
Reference in New Issue