[llvm] r270480 - tune lowering parameter for small apps (sjeng)

Xinliang David Li via llvm-commits llvm-commits at lists.llvm.org
Mon May 23 12:29:26 PDT 2016


Author: davidxl
Date: Mon May 23 14:29:26 2016
New Revision: 270480

URL: http://llvm.org/viewvc/llvm-project?rev=270480&view=rev
Log:
tune lowering parameter for small apps (sjeng)

Modified:
    llvm/trunk/lib/Transforms/Instrumentation/InstrProfiling.cpp

Modified: llvm/trunk/lib/Transforms/Instrumentation/InstrProfiling.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/InstrProfiling.cpp?rev=270480&r1=270479&r2=270480&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/InstrProfiling.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/InstrProfiling.cpp Mon May 23 14:29:26 2016
@@ -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[] = {




More information about the llvm-commits mailing list