summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorXinliang David Li <davidxl@google.com>2016-05-23 19:29:26 +0000
committerXinliang David Li <davidxl@google.com>2016-05-23 19:29:26 +0000
commite45207608c8fa02ef34b970c63150b21f8c0afb5 (patch)
tree850a95a907287b57fd4fc3bd45b3a89a0b1453a9 /llvm/lib
parent00e7092f68fe462b7a1dbcf424f66de60180f687 (diff)
downloadbcm5719-llvm-e45207608c8fa02ef34b970c63150b21f8c0afb5.tar.gz
bcm5719-llvm-e45207608c8fa02ef34b970c63150b21f8c0afb5.zip
tune lowering parameter for small apps (sjeng)
llvm-svn: 270480
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp b/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
index eeb49910e37..97e8bd1ae11 100644
--- a/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
+++ b/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
@@ -447,8 +447,9 @@ void InstrProfiling::emitVNodes() {
// the average number of counters per site is low. For small
// apps with very few sites, this may not be true. Bump up the
// number of counters in this case.
- if (NumCounters < 10)
- NumCounters *= 2;
+#define INSTR_PROF_MIN_VAL_COUNTS 10
+ if (NumCounters < INSTR_PROF_MIN_VAL_COUNTS)
+ NumCounters = std::max(INSTR_PROF_MIN_VAL_COUNTS, (int) NumCounters * 2);
auto &Ctx = M->getContext();
Type *VNodeTypes[] = {
OpenPOWER on IntegriCloud