[Mesa-dev] [PATCH v2] ac: fix visit_ssa_undef() for doubles

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Thu Jan 18 12:24:25 UTC 2018


Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>

On Thu, Jan 18, 2018 at 2:15 AM, Timothy Arceri <tarceri at itsqueeze.com> wrote:
> V2: use LLVMIntTypeInContext()
>
> Fixes: f4e499ec7914 "radv: add initial non-conformant radv vulkan driver"
> ---
>  src/amd/common/ac_nir_to_llvm.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
> index 5d582cb0ed..bbbeeccd53 100644
> --- a/src/amd/common/ac_nir_to_llvm.c
> +++ b/src/amd/common/ac_nir_to_llvm.c
> @@ -5052,12 +5052,13 @@ static void visit_ssa_undef(struct ac_nir_context *ctx,
>                             const nir_ssa_undef_instr *instr)
>  {
>         unsigned num_components = instr->def.num_components;
> +       LLVMTypeRef type = LLVMIntTypeInContext(ctx->ac.context, instr->def.bit_size);
>         LLVMValueRef undef;
>
>         if (num_components == 1)
> -               undef = LLVMGetUndef(ctx->ac.i32);
> +               undef = LLVMGetUndef(type);
>         else {
> -               undef = LLVMGetUndef(LLVMVectorType(ctx->ac.i32, num_components));
> +               undef = LLVMGetUndef(LLVMVectorType(type, num_components));
>         }
>         _mesa_hash_table_insert(ctx->defs, &instr->def, undef);
>  }
> --
> 2.14.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list