summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Shih-wei Liao <sliao@google.com> 2012-05-08 01:04:03 -0700
committer Shih-wei Liao <sliao@google.com> 2012-05-08 01:04:03 -0700
commite0e4024b2e3f6fa6feb3ef42f0f072ffb004f8f7 (patch)
tree7db4374ad2630d5d9870248c441a60e80a658502
parent9199e7237615d31d943941f2b27c6f7709d88c05 (diff)
Reduce memory usage by halving the materialization threshold.
Also, functions declared with __attribute__((always_inline)) MUST be inlined. Note that FunctionInlining uses a heuristic to inline direct function calls to small functions. Function size (computed by # of basic blocks * some factors) < Inlining-threshold will be inlined. But invoke* insn should be inlined by other means anyway. Change-Id: I3f06ead75c78dfc83985458809311b7fa78bc1d7
-rw-r--r--src/compiler_llvm/compilation_unit.cc4
-rw-r--r--src/compiler_llvm/compilation_unit.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/compiler_llvm/compilation_unit.cc b/src/compiler_llvm/compilation_unit.cc
index e7f77e21ce..1c473921cf 100644
--- a/src/compiler_llvm/compilation_unit.cc
+++ b/src/compiler_llvm/compilation_unit.cc
@@ -347,8 +347,8 @@ bool CompilationUnit::MaterializeToFile(int output_fd,
// Add optimization pass
llvm::PassManagerBuilder pm_builder;
- pm_builder.Inliner = llvm::createFunctionInliningPass();
- //pm_builder.Inliner = llvm::createAlwaysInlinerPass();
+ //pm_builder.Inliner = llvm::createFunctionInliningPass();
+ pm_builder.Inliner = llvm::createAlwaysInlinerPass();
//pm_builder.Inliner = llvm::createPartialInliningPass();
pm_builder.OptLevel = 3;
pm_builder.DisableSimplifyLibCalls = 1;
diff --git a/src/compiler_llvm/compilation_unit.h b/src/compiler_llvm/compilation_unit.h
index fb5f4e432e..a464df0b8c 100644
--- a/src/compiler_llvm/compilation_unit.h
+++ b/src/compiler_llvm/compilation_unit.h
@@ -98,7 +98,7 @@ class CompilationUnit {
bool IsMaterializeThresholdReached() const {
MutexLock GUARD(cunit_lock_);
- return (mem_usage_ > 10000000u); // (threshold: 10 MB)
+ return (mem_usage_ > 5000000u); // (threshold: 5 MB)
}
void AddMemUsageApproximation(size_t usage) {