i965/fs: fill allocated memory with zeros where needed
authorJuha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Tue, 11 Oct 2016 10:48:16 +0000 (13:48 +0300)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 31 Oct 2016 10:53:38 +0000 (11:53 +0100)
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
src/mesa/drivers/dri/i965/brw_fs_dead_code_eliminate.cpp

index e4e6816e0e46d312ffc58c49fc3f2947214004fb..da835cb98d3cd57da7c807e2b194809766cbea3a 100644 (file)
@@ -798,7 +798,7 @@ fs_visitor::opt_copy_propagate_local(void *copy_prop_ctx, bblock_t *block,
             const unsigned size_written = effective_width *
                                           type_sz(inst->src[i].type);
             if (inst->src[i].file == VGRF) {
-               acp_entry *entry = ralloc(copy_prop_ctx, acp_entry);
+               acp_entry *entry = rzalloc(copy_prop_ctx, acp_entry);
                entry->dst = byte_offset(inst->dst, offset);
                entry->src = inst->src[i];
                entry->size_written = size_written;
index 5db31c3871d5571f724ad79c1fc3ccc7fe8250c5..8a0469a51b90d129ad9a48a88da66623b8f0b6c4 100644 (file)
@@ -42,8 +42,8 @@ fs_visitor::dead_code_eliminate()
    calculate_live_intervals();
 
    int num_vars = live_intervals->num_vars;
-   BITSET_WORD *live = ralloc_array(NULL, BITSET_WORD, BITSET_WORDS(num_vars));
-   BITSET_WORD *flag_live = ralloc_array(NULL, BITSET_WORD, 1);
+   BITSET_WORD *live = rzalloc_array(NULL, BITSET_WORD, BITSET_WORDS(num_vars));
+   BITSET_WORD *flag_live = rzalloc_array(NULL, BITSET_WORD, 1);
 
    foreach_block_reverse_safe(block, cfg) {
       memcpy(live, live_intervals->block_data[block->num].liveout,