[Mesa-dev] [PATCH] radeonsi: Do not set both inreg and byval

Marek Olšák maraeo at gmail.com
Sun Oct 20 21:36:03 CEST 2013


Reviewed-by: Marek Olšák <marek.olsak at amd.com>

BTW, the LLVM changes must land first.

Marek

On Fri, Oct 11, 2013 at 5:32 PM, Vincent Lejeune <vljn at ovi.com> wrote:
> ---
>  src/gallium/drivers/radeonsi/radeonsi_shader.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/src/gallium/drivers/radeonsi/radeonsi_shader.c b/src/gallium/drivers/radeonsi/radeonsi_shader.c
> index ab996cc..209b77e 100644
> --- a/src/gallium/drivers/radeonsi/radeonsi_shader.c
> +++ b/src/gallium/drivers/radeonsi/radeonsi_shader.c
> @@ -1655,16 +1655,19 @@ static void create_function(struct si_shader_context *si_shader_ctx)
>
>         for (i = 0; i <= last_sgpr; ++i) {
>                 LLVMValueRef P = LLVMGetParam(si_shader_ctx->radeon_bld.main_fn, i);
> -               LLVMAddAttribute(P, LLVMInRegAttribute);
> +               switch (i) {
> +               default:
> +                       LLVMAddAttribute(P, LLVMInRegAttribute);
> +                       break;
> +#if HAVE_LLVM >= 0x0304
>                 /* We tell llvm that array inputs are passed by value to allow Sinking pass
>                  * to move load. Inputs are constant so this is fine. */
> -               switch (i) {
> -               default: break;
>                 case SI_PARAM_CONST:
>                 case SI_PARAM_SAMPLER:
>                 case SI_PARAM_RESOURCE:
>                         LLVMAddAttribute(P, LLVMByValAttribute);
>                         break;
> +#endif
>                 }
>         }
>
> --
> 1.8.3.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list