diff options
author | Marek Olšák <marek.olsak@amd.com> | 2018-04-09 19:13:37 -0400 |
---|---|---|
committer | Marek Olšák <marek.olsak@amd.com> | 2018-04-27 17:56:04 -0400 |
commit | 797d673c9a8c2d0a392f80b3c2190606ba8a6c83 (patch) | |
tree | 76e34db0ba1ad6cd415d259b74afedd78cb7a597 /src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c | |
parent | c1823ff661b016defe93baa0038e5fd6ca8522c4 (diff) |
radeonsi: move passmgr into si_compiler
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Tested-by: Benedikt Schemmer <ben at besd.de>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c | 34 |
1 files changed, 1 insertions, 33 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c b/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c index 86366f4063c..29b1e50dc47 100644 --- a/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c +++ b/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c @@ -39,11 +39,6 @@ #include "util/u_debug.h" #include <stdio.h> -#include <llvm-c/Transforms/IPO.h> -#include <llvm-c/Transforms/Scalar.h> -#if HAVE_LLVM >= 0x0700 -#include <llvm-c/Transforms/Utils.h> -#endif enum si_llvm_calling_convention { RADEON_LLVM_AMDGPU_VS = 87, @@ -1212,41 +1207,14 @@ void si_llvm_create_func(struct si_shader_context *ctx, void si_llvm_optimize_module(struct si_shader_context *ctx) { - struct gallivm_state *gallivm = &ctx->gallivm; - /* Dump LLVM IR before any optimization passes */ if (ctx->screen->debug_flags & DBG(PREOPT_IR) && si_can_dump_shader(ctx->screen, ctx->type)) LLVMDumpModule(ctx->gallivm.module); - /* Create the pass manager */ - gallivm->passmgr = LLVMCreatePassManager(); - - LLVMAddTargetLibraryInfo(ctx->compiler->target_library_info, - gallivm->passmgr); - - if (si_extra_shader_checks(ctx->screen, ctx->type)) - LLVMAddVerifierPass(gallivm->passmgr); - - LLVMAddAlwaysInlinerPass(gallivm->passmgr); - - /* This pass should eliminate all the load and store instructions */ - LLVMAddPromoteMemoryToRegisterPass(gallivm->passmgr); - - /* Add some optimization passes */ - LLVMAddScalarReplAggregatesPass(gallivm->passmgr); - LLVMAddLICMPass(gallivm->passmgr); - LLVMAddAggressiveDCEPass(gallivm->passmgr); - LLVMAddCFGSimplificationPass(gallivm->passmgr); - /* This is recommended by the instruction combining pass. */ - LLVMAddEarlyCSEMemSSAPass(gallivm->passmgr); - LLVMAddInstructionCombiningPass(gallivm->passmgr); - /* Run the pass */ - LLVMRunPassManager(gallivm->passmgr, ctx->gallivm.module); - + LLVMRunPassManager(ctx->compiler->passmgr, ctx->gallivm.module); LLVMDisposeBuilder(ctx->ac.builder); - LLVMDisposePassManager(gallivm->passmgr); } void si_llvm_dispose(struct si_shader_context *ctx) |