ac: fix visit_ssa_undef() for doubles
authorTimothy Arceri <tarceri@itsqueeze.com>
Thu, 18 Jan 2018 01:01:33 +0000 (12:01 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Thu, 18 Jan 2018 21:09:04 +0000 (08:09 +1100)
V2: use LLVMIntTypeInContext()

Fixes: f4e499ec7914 "radv: add initial non-conformant radv vulkan driver"
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/common/ac_nir_to_llvm.c

index 02a46dab4db63458b20a02a9b3a19acba3b39d14..cd400376a0e9048ef97eedbcecde5cbf548cf833 100644 (file)
@@ -5055,12 +5055,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);
 }