[Mesa-dev] [PATCH] radeonsi: initialize and finalize the LLVM function pass manager

Marek Olšák maraeo at gmail.com
Thu Aug 11 23:26:08 UTC 2016


From: Marek Olšák <marek.olsak at amd.com>

we should do that allegedly
---
 src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c b/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c
index d75311e..e04e26a 100644
--- a/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c
+++ b/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c
@@ -1918,21 +1918,23 @@ void radeon_llvm_finalize_module(struct radeon_llvm_context *ctx)
 	LLVMAddPromoteMemoryToRegisterPass(gallivm->passmgr);
 
 	/* Add some optimization passes */
 	LLVMAddScalarReplAggregatesPass(gallivm->passmgr);
 	LLVMAddLICMPass(gallivm->passmgr);
 	LLVMAddAggressiveDCEPass(gallivm->passmgr);
 	LLVMAddCFGSimplificationPass(gallivm->passmgr);
 	LLVMAddInstructionCombiningPass(gallivm->passmgr);
 
 	/* Run the pass */
+	LLVMInitializeFunctionPassManager(gallivm->passmgr);
 	LLVMRunFunctionPassManager(gallivm->passmgr, ctx->main_fn);
+	LLVMFinalizeFunctionPassManager(gallivm->passmgr);
 
 	LLVMDisposeBuilder(gallivm->builder);
 	LLVMDisposePassManager(gallivm->passmgr);
 	gallivm_dispose_target_library_info(target_library_info);
 }
 
 void radeon_llvm_dispose(struct radeon_llvm_context *ctx)
 {
 	LLVMDisposeModule(ctx->soa.bld_base.base.gallivm->module);
 	LLVMContextDispose(ctx->soa.bld_base.base.gallivm->context);
-- 
2.7.4



More information about the mesa-dev mailing list