[Bf-blender-cvs] [c590f30] object_nodes: Set a target triple and data layout for modules.

Lukas Tönne noreply at git.blender.org
Wed Jun 15 16:46:12 CEST 2016


Commit: c590f30623e545b4fa589449bc97537bc3e567bb
Author: Lukas Tönne
Date:   Thu Jun 9 15:40:11 2016 +0200
Branches: object_nodes
https://developer.blender.org/rBc590f30623e545b4fa589449bc97537bc3e567bb

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

===================================================================

M	source/blender/blenvm/llvm/llvm_compiler.cc

===================================================================

diff --git a/source/blender/blenvm/llvm/llvm_compiler.cc b/source/blender/blenvm/llvm/llvm_compiler.cc
index e194766..ccb3395 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;




More information about the Bf-blender-cvs mailing list