diff options
author | Nicolai Hähnle <[email protected]> | 2016-10-28 14:42:46 +0200 |
---|---|---|
committer | Nicolai Hähnle <[email protected]> | 2016-11-03 10:06:42 +0100 |
commit | 23dfb688ba3b7be0feb2a178e65e419fe2678379 (patch) | |
tree | b200565eb211d9deed5d505e0426a450d9162566 | |
parent | 4ada1dabc4792918ce59224d27bef29c106ca0ca (diff) |
radeonsi: add always-inline pass to si_llvm_finalize_module
Change the pass manager as well, since this is a module-level pass. No
noticeable run-time difference on shader-db.
Reviewed-by: Marek Olšák <[email protected]>
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c b/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c index c7a08cc72cb..2d82574690c 100644 --- a/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c +++ b/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c @@ -38,6 +38,7 @@ #include "util/u_debug.h" #include <stdio.h> +#include <llvm-c/Transforms/IPO.h> #include <llvm-c/Transforms/Scalar.h> /* Data for if/else/endif and bgnloop/endloop control flow structures. @@ -1333,8 +1334,7 @@ void si_llvm_finalize_module(struct si_shader_context *ctx, LLVMTargetLibraryInfoRef target_library_info; /* Create the pass manager */ - gallivm->passmgr = LLVMCreateFunctionPassManagerForModule( - gallivm->module); + gallivm->passmgr = LLVMCreatePassManager(); target_library_info = gallivm_create_target_library_info(triple); LLVMAddTargetLibraryInfo(target_library_info, gallivm->passmgr); @@ -1342,6 +1342,8 @@ void si_llvm_finalize_module(struct si_shader_context *ctx, if (run_verifier) LLVMAddVerifierPass(gallivm->passmgr); + LLVMAddAlwaysInlinerPass(gallivm->passmgr); + /* This pass should eliminate all the load and store instructions */ LLVMAddPromoteMemoryToRegisterPass(gallivm->passmgr); @@ -1353,9 +1355,7 @@ void si_llvm_finalize_module(struct si_shader_context *ctx, LLVMAddInstructionCombiningPass(gallivm->passmgr); /* Run the pass */ - LLVMInitializeFunctionPassManager(gallivm->passmgr); - LLVMRunFunctionPassManager(gallivm->passmgr, ctx->main_fn); - LLVMFinalizeFunctionPassManager(gallivm->passmgr); + LLVMRunPassManager(gallivm->passmgr, ctx->gallivm.module); LLVMDisposeBuilder(gallivm->builder); LLVMDisposePassManager(gallivm->passmgr); |