diff options
author | Dave Airlie <[email protected]> | 2018-06-27 08:52:20 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2018-07-04 05:18:01 +1000 |
commit | 584ad1eda956f89338648fcd22e950ab9c32f465 (patch) | |
tree | 4d00a1f93e8bba73693a081ad1202108c879f0d5 /src/gallium/drivers/radeonsi/si_pipe.c | |
parent | f2b3e96e754a5d722f2b0fa1bd5efa1c0640ed3b (diff) |
ac/radeonsi: refactor out pass manager init to common code.
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_pipe.c')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_pipe.c | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index 0d6d93a7358..0f58286fed1 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -41,12 +41,6 @@ #include "vl/vl_decoder.h" #include "driver_ddebug/dd_util.h" -#include <llvm-c/Transforms/IPO.h> -#include <llvm-c/Transforms/Scalar.h> -#if HAVE_LLVM >= 0x0700 -#include <llvm-c/Transforms/Utils.h> -#endif - static const struct debug_named_value debug_options[] = { /* Shader logging options: */ { "vs", DBG(VS), "Print vertex shaders" }, @@ -131,27 +125,10 @@ static void si_init_compiler(struct si_screen *sscreen, if (!compiler->target_library_info) return; - compiler->passmgr = LLVMCreatePassManager(); + compiler->passmgr = ac_create_passmgr(compiler->target_library_info, + (sscreen->debug_flags & DBG(CHECK_IR))); if (!compiler->passmgr) return; - - LLVMAddTargetLibraryInfo(compiler->target_library_info, - compiler->passmgr); - - /* Add LLVM passes into the pass manager. */ - if (sscreen->debug_flags & DBG(CHECK_IR)) - LLVMAddVerifierPass(compiler->passmgr); - - LLVMAddAlwaysInlinerPass(compiler->passmgr); - /* This pass should eliminate all the load and store instructions. */ - LLVMAddPromoteMemoryToRegisterPass(compiler->passmgr); - LLVMAddScalarReplAggregatesPass(compiler->passmgr); - LLVMAddLICMPass(compiler->passmgr); - LLVMAddAggressiveDCEPass(compiler->passmgr); - LLVMAddCFGSimplificationPass(compiler->passmgr); - /* This is recommended by the instruction combining pass. */ - LLVMAddEarlyCSEMemSSAPass(compiler->passmgr); - LLVMAddInstructionCombiningPass(compiler->passmgr); } static void si_destroy_compiler(struct si_compiler *compiler) |