[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mesa3d-dev
Subject:    Re: [Mesa-dev] [PATCH 07/11] ac/radv: move llvm compiler info to struct and init in one place
From:       Marek Olšák <maraeo () gmail ! com>
Date:       2018-06-30 3:30:02
Message-ID: CAAxE2A7i+8J6Vf9FcNdFuNj0P7RfAu3VXNY8hU9KdxoGft5ePw () mail ! gmail ! com
[Download RAW message or body]

On Tue, Jun 26, 2018 at 11:58 PM, Dave Airlie <airlied@gmail.com> wrote:
> From: Dave Airlie <airlied@redhat.com>
>
> This creates a common per-thread compiler info struct, and adds
> the init code to it. This is mostly ported from radeonsi.
>
> The common info struct is used in radv first and replaces the
> current code.
> ---
>  src/amd/common/ac_llvm_util.c     | 50 +++++++++++++++++++++++++++++++
>  src/amd/common/ac_llvm_util.h     | 14 +++++++++
>  src/amd/vulkan/radv_nir_to_llvm.c | 39 ++++++++++--------------
>  src/amd/vulkan/radv_private.h     |  7 ++---
>  src/amd/vulkan/radv_shader.c      | 16 +++++-----
>  5 files changed, 91 insertions(+), 35 deletions(-)
>
> diff --git a/src/amd/common/ac_llvm_util.c b/src/amd/common/ac_llvm_util.c
> index dd2469d4606..85dc9d72a5c 100644
> --- a/src/amd/common/ac_llvm_util.c
> +++ b/src/amd/common/ac_llvm_util.c
> @@ -188,6 +188,56 @@ LLVMPassManagerRef ac_init_passmgr(LLVMTargetLibraryInfoRef target_library_info,
>         return passmgr;
>  }
>
> +bool ac_llvm_compiler_init(struct ac_llvm_compiler_info *info,
> +                          bool add_target_library_info,
> +                          enum radeon_family family,
> +                          enum ac_target_machine_options tm_options)
> +{
> +       memset(info, 0, sizeof(*info));
> +       info->tm = ac_create_target_machine(family, tm_options, &info->triple);
> +       if (!info->tm)
> +               return false;
> +
> +       /* Get the data layout. */
> +       LLVMTargetDataRef data_layout = LLVMCreateTargetDataLayout(info->tm);
> +       if (!data_layout)
> +               goto fail;
> +       info->data_layout = LLVMCopyStringRepOfTargetData(data_layout);
> +       LLVMDisposeTargetData(data_layout);
> +
> +#if HAVE_LLVM < 0x0700

This #if is not needed. You already have a bool flag coming from radv.
You can modify the bool value in radv.

> +       if (add_target_library_info)
> +#endif

Marek
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic