gallivm: handle non-32 bit undefined
authorDave Airlie <airlied@redhat.com>
Thu, 12 Dec 2019 02:42:25 +0000 (12:42 +1000)
committerDave Airlie <airlied@redhat.com>
Fri, 27 Dec 2019 03:26:33 +0000 (13:26 +1000)
other sized undefs caused llvm asserts

Acked-by: Roland Scheidegger <sroland@vmware.com>
src/gallium/auxiliary/gallivm/lp_bld_nir.c

index a150473b2a6c5569d138b66c80ec4a3780c072ff..f2fb76aeba24540e5f1febf19c317f9d0d4f66fb 100644 (file)
@@ -1615,8 +1615,9 @@ static void visit_ssa_undef(struct lp_build_nir_context *bld_base,
 {
    unsigned num_components = instr->def.num_components;
    LLVMValueRef undef[NIR_MAX_VEC_COMPONENTS];
+   struct lp_build_context *undef_bld = get_int_bld(bld_base, true, instr->def.bit_size);
    for (unsigned i = 0; i < num_components; i++)
-      undef[i] = LLVMGetUndef(bld_base->base.vec_type);
+      undef[i] = LLVMGetUndef(undef_bld->vec_type);
    assign_ssa_dest(bld_base, &instr->def, undef);
 }