summaryrefslogtreecommitdiff
path: root/src/compiler_llvm/compilation_unit.cc
diff options
context:
space:
mode:
author Shih-wei Liao <sliao@google.com> 2012-04-16 19:23:59 -0700
committer Shih-wei Liao <sliao@google.com> 2012-04-16 19:23:59 -0700
commit54a3e919ef3c8788e39a21696944d00826c25af3 (patch)
treec2352ca3d95dc0e5af8f8bc177dd66b74a6e0c4c /src/compiler_llvm/compilation_unit.cc
parentd4ae660ad815f903757f00a6058649d984512b2a (diff)
Compilation_unit experiment.
Change-Id: I79576c1564daffc74100172ca0d8f91a087c7b1e
Diffstat (limited to 'src/compiler_llvm/compilation_unit.cc')
-rw-r--r--src/compiler_llvm/compilation_unit.cc18
1 files changed, 1 insertions, 17 deletions
diff --git a/src/compiler_llvm/compilation_unit.cc b/src/compiler_llvm/compilation_unit.cc
index 09e193d46b..32f17869cb 100644
--- a/src/compiler_llvm/compilation_unit.cc
+++ b/src/compiler_llvm/compilation_unit.cc
@@ -204,7 +204,7 @@ bool CompilationUnit::Materialize() {
llvm::TargetMachine* target_machine =
target->createTargetMachine(target_triple, "", target_attr, target_options,
llvm::Reloc::Static, llvm::CodeModel::Small,
- llvm::CodeGenOpt::Aggressive);
+ llvm::CodeGenOpt::None);
CHECK(target_machine != NULL) << "Failed to create target machine";
@@ -220,14 +220,6 @@ bool CompilationUnit::Materialize() {
llvm::FunctionPassManager fpm(module_);
fpm.add(new llvm::TargetData(*target_data));
- // Add optimization pass
- llvm::PassManagerBuilder pm_builder;
- pm_builder.Inliner = NULL; // TODO: add some inline in the future
- pm_builder.OptLevel = 3;
- pm_builder.DisableSimplifyLibCalls = 1;
- pm_builder.populateModulePassManager(pm);
- pm_builder.populateFunctionPassManager(fpm);
-
// Add passes to emit ELF image
{
llvm::formatted_raw_ostream formatted_os(
@@ -245,14 +237,6 @@ bool CompilationUnit::Materialize() {
// Add pass to update the frame_size_in_bytes_
pm.add(new ::UpdateFrameSizePass(this));
- // Run the per-function optimization
- fpm.doInitialization();
- for (llvm::Module::iterator F = module_->begin(), E = module_->end();
- F != E; ++F) {
- fpm.run(*F);
- }
- fpm.doFinalization();
-
// Run the code generation passes
pm.run(*module_);
}