Skip to content

Commit 49aaca2

Browse files
committed
Address comments
1 parent d3b8bcb commit 49aaca2

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,10 @@ static cl::opt<bool> AllowRecursiveContexts(
181181
"memprof-allow-recursive-contexts", cl::init(true), cl::Hidden,
182182
cl::desc("Allow cloning of contexts having recursive cycles"));
183183

184-
// Set the minimum absolute count threshold for inlining of indirect calls
185-
// promoted during cloning.
186-
static cl::opt<unsigned> ICPInlineMinimumCountThreshold(
187-
"memprof-icp-inline-minimum-count-threshold", cl::init(0), cl::Hidden,
184+
// Set the minimum absolute count threshold for allowing inlining of indirect
185+
// calls promoted during cloning.
186+
static cl::opt<unsigned> MemProfICPNoInlineThreshold(
187+
"memprof-icp-noinline-threshold", cl::init(2), cl::Hidden,
188188
cl::desc("Minimum absolute count for promoted target to be inlinable"));
189189

190190
namespace llvm {
@@ -5579,8 +5579,8 @@ void MemProfContextDisambiguation::performICP(
55795579
.getCallee());
55805580
}
55815581
DirectCall.setCalledFunction(TargetToUse);
5582-
if (ICPInlineMinimumCountThreshold &&
5583-
Candidate.Count < ICPInlineMinimumCountThreshold)
5582+
if (MemProfICPNoInlineThreshold &&
5583+
Candidate.Count < MemProfICPNoInlineThreshold)
55845584
DirectCall.setIsNoInline();
55855585
ORE.emit(OptimizationRemark(DEBUG_TYPE, "MemprofCall", CBClone)
55865586
<< ore::NV("Call", CBClone) << " in clone "

llvm/test/ThinLTO/X86/memprof-icp-recursive.ll

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,10 @@
5656

5757
; RUN: llvm-dis %t.out.2.4.opt.bc -o - | FileCheck %s --check-prefixes=IR,IR-INLINE
5858

59-
;; Next, add a threshold to prevent inlining of small count promoted calls.
59+
;; Next, add a threshold to prevent inlining of the promoted calls which have
60+
;; count 2 (the default threshold of 2 means they are inlinable by default).
6061
; RUN: llvm-lto2 run %t/main.o %t/foo.o -enable-memprof-context-disambiguation \
61-
; RUN: -memprof-icp-inline-minimum-count-threshold=3 \
62+
; RUN: -memprof-icp-noinline-threshold=3 \
6263
; RUN: -enable-memprof-indirect-call-support=true \
6364
; RUN: -memprof-allow-recursive-callsites \
6465
; RUN: -supports-hot-cold-new \

0 commit comments

Comments
 (0)