diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2016-06-09 16:40:11 +0300 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2016-06-09 16:44:39 +0300 |
commit | c590f30623e545b4fa589449bc97537bc3e567bb (patch) | |
tree | b60f5894c97d1eecab8e4d6290efe6179fe96b3f /source | |
parent | 6d4dd66d1fd4d0fdab930715c52cf1072359ab34 (diff) |
Set a target triple and data layout for modules.
According to the site below, this is necessary for proper optimization.
http://llvm.org/docs/Frontend/PerformanceTips.html
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenvm/llvm/llvm_compiler.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/blenvm/llvm/llvm_compiler.cc b/source/blender/blenvm/llvm/llvm_compiler.cc index e19476699b5..ccb33959842 100644 --- a/source/blender/blenvm/llvm/llvm_compiler.cc +++ b/source/blender/blenvm/llvm/llvm_compiler.cc @@ -177,6 +177,9 @@ void LLVMCompilerBase::optimize_function(llvm::Function *func, int opt_level) using legacy::FunctionPassManager; using legacy::PassManager; + module()->setDataLayout(llvm_execution_engine()->getDataLayout()); + module()->setTargetTriple(llvm_execution_engine()->getTargetMachine()->getTargetTriple()); + FunctionPassManager FPM(module()); PassManager MPM; |