[Mesa-dev] [PATCH 04/11] radv: port to use common passmgr code.
Marek Olšák
maraeo at gmail.com
Tue Jul 3 17:11:56 UTC 2018
If radeonsi adds target library info, I highly recommend that radv does the
same thing.
Marek
On Mon, Jul 2, 2018, 8:48 PM Dave Airlie <airlied at gmail.com> wrote:
> From: Dave Airlie <airlied at redhat.com>
>
> This adds a inline always pass, but otherwise should work the
> same.
> ---
> src/amd/common/ac_llvm_util.c | 5 +++--
> src/amd/vulkan/radv_nir_to_llvm.c | 26 +++-----------------------
> 2 files changed, 6 insertions(+), 25 deletions(-)
>
> diff --git a/src/amd/common/ac_llvm_util.c b/src/amd/common/ac_llvm_util.c
> index adcdc730856..b1ae8ab9986 100644
> --- a/src/amd/common/ac_llvm_util.c
> +++ b/src/amd/common/ac_llvm_util.c
> @@ -172,8 +172,9 @@ LLVMPassManagerRef
> ac_init_passmgr(LLVMTargetLibraryInfoRef target_library_info,
> if (!passmgr)
> return NULL;
>
> - LLVMAddTargetLibraryInfo(target_library_info,
> - passmgr);
> + if (target_library_info)
> + LLVMAddTargetLibraryInfo(target_library_info,
> + passmgr);
>
> if (check_ir)
> LLVMAddVerifierPass(passmgr);
> diff --git a/src/amd/vulkan/radv_nir_to_llvm.c
> b/src/amd/vulkan/radv_nir_to_llvm.c
> index ce6d5e1547d..d454040a05e 100644
> --- a/src/amd/vulkan/radv_nir_to_llvm.c
> +++ b/src/amd/vulkan/radv_nir_to_llvm.c
> @@ -2996,30 +2996,10 @@ static void ac_llvm_finalize_module(struct
> radv_shader_context *ctx,
> const struct radv_nir_compiler_options
> *options)
> {
> LLVMPassManagerRef passmgr;
> - /* Create the pass manager */
> - passmgr = LLVMCreateFunctionPassManagerForModule(
> - ctx->ac.module);
> -
> - if (options->check_ir)
> - LLVMAddVerifierPass(passmgr);
> -
> - /* This pass should eliminate all the load and store instructions
> */
> - LLVMAddPromoteMemoryToRegisterPass(passmgr);
> -
> - /* Add some optimization passes */
> - LLVMAddScalarReplAggregatesPass(passmgr);
> - LLVMAddLICMPass(passmgr);
> - LLVMAddAggressiveDCEPass(passmgr);
> - LLVMAddCFGSimplificationPass(passmgr);
> - /* This is recommended by the instruction combining pass. */
> - LLVMAddEarlyCSEMemSSAPass(passmgr);
> - LLVMAddInstructionCombiningPass(passmgr);
> -
> - /* Run the pass */
> - LLVMInitializeFunctionPassManager(passmgr);
> - LLVMRunFunctionPassManager(passmgr, ctx->main_function);
> - LLVMFinalizeFunctionPassManager(passmgr);
>
> + passmgr = ac_init_passmgr(NULL, options->check_ir);
> +
> + LLVMRunPassManager(passmgr, ctx->ac.module);
> LLVMDisposeBuilder(ctx->ac.builder);
> LLVMDisposePassManager(passmgr);
>
> --
> 2.17.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180703/eb36b486/attachment-0001.html>
More information about the mesa-dev
mailing list