i965/cfg: Initialize bblock_t::cycle_count.
authorMatt Turner <mattst88@gmail.com>
Mon, 28 Nov 2016 21:25:01 +0000 (13:25 -0800)
committerMatt Turner <mattst88@gmail.com>
Tue, 29 Nov 2016 19:53:36 +0000 (11:53 -0800)
schedule_instructions(bblock_t *) isn't called on blocks with a single
instruction, and since it is the only thing that set cycle_count,
cycle_count would be uninitialized.

A non-empty block with bblock_t::cycle_count == 0 is arguably a bug.
That'll be fixed in the next commit.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
src/mesa/drivers/dri/i965/brw_cfg.cpp

index ff2cf6affad7ab0eeade4cb23d0ee4c1386318e5..fad12eec588c622a64fc371451ecdb83d0486fde 100644 (file)
@@ -51,7 +51,7 @@ link(void *mem_ctx, bblock_t *block)
 }
 
 bblock_t::bblock_t(cfg_t *cfg) :
-   cfg(cfg), idom(NULL), start_ip(0), end_ip(0), num(0)
+   cfg(cfg), idom(NULL), start_ip(0), end_ip(0), num(0), cycle_count(0)
 {
    instructions.make_empty();
    parents.make_empty();