const nir_shader_compiler_options *options,
shader_info *si)
{
- nir_shader *shader = ralloc(mem_ctx, nir_shader);
+ nir_shader *shader = rzalloc(mem_ctx, nir_shader);
exec_list_make_empty(&shader->uniforms);
exec_list_make_empty(&shader->inputs);
nir_block *
nir_block_create(nir_shader *shader)
{
- nir_block *block = ralloc(shader, nir_block);
+ nir_block *block = rzalloc(shader, nir_block);
cf_init(&block->cf_node, nir_cf_node_block);
static bool
nir_opt_dce_impl(nir_function_impl *impl)
{
- struct exec_list *worklist = ralloc(NULL, struct exec_list);
+ struct exec_list *worklist = rzalloc(NULL, struct exec_list);
exec_list_make_empty(worklist);
nir_foreach_block(block, impl) {
struct nir_phi_builder *
nir_phi_builder_create(nir_function_impl *impl)
{
- struct nir_phi_builder *pb = ralloc(NULL, struct nir_phi_builder);
+ struct nir_phi_builder *pb = rzalloc(NULL, struct nir_phi_builder);
pb->shader = impl->function->shader;
pb->impl = impl;
build_bitsize_tree(void *mem_ctx, struct match_state *state,
const nir_search_value *value)
{
- bitsize_tree *tree = ralloc(mem_ctx, bitsize_tree);
+ bitsize_tree *tree = rzalloc(mem_ctx, bitsize_tree);
switch (value->type) {
case nir_search_value_expression: {
state->mem_ctx = ralloc_parent(impl);
state->ssa_map = _mesa_hash_table_create(NULL, _mesa_hash_pointer,
_mesa_key_pointer_equal);
- state->states = ralloc_array(NULL, reg_state, impl->reg_alloc);
+ state->states = rzalloc_array(NULL, reg_state, impl->reg_alloc);
foreach_list_typed(nir_register, reg, node, &impl->registers) {
assert(reg->index < impl->reg_alloc);
w->blocks_present = rzalloc_array(mem_ctx, BITSET_WORD,
BITSET_WORDS(num_blocks));
- w->blocks = ralloc_array(mem_ctx, nir_block *, num_blocks);
+ w->blocks = rzalloc_array(mem_ctx, nir_block *, num_blocks);
}
void