Due to flow control we can end up with random values in here having
side effects.
This fixes a crash in gtk4-demo.
Fixes:
44a6b0107b37 ("gallivm: add nir->llvm translation (v2)")
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7327>
nir_foreach_register(reg, &func->impl->registers) {
LLVMTypeRef type = get_register_type(bld_base, reg);
- LLVMValueRef reg_alloc = lp_build_alloca_undef(bld_base->base.gallivm,
- type, "reg");
+ LLVMValueRef reg_alloc = lp_build_alloca(bld_base->base.gallivm,
+ type, "reg");
_mesa_hash_table_insert(bld_base->regs, reg, reg_alloc);
}
nir_index_ssa_defs(func->impl);