i965/fs: Properly calculate the number of instructions in calculate_register_pressure
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 26 Sep 2014 23:08:52 +0000 (16:08 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 30 Sep 2014 17:29:15 +0000 (10:29 -0700)
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_fs.cpp

index b9bd94c3070d275ba116678fe97497732114d569..6ed3e95ef6ee71c1e43ebe5ed215c349927d1ea5 100644 (file)
@@ -3400,7 +3400,9 @@ fs_visitor::calculate_register_pressure()
    invalidate_live_intervals();
    calculate_live_intervals();
 
-   unsigned num_instructions = instructions.length();
+   unsigned num_instructions = 0;
+   foreach_block(block, cfg)
+      num_instructions += block->instructions.length();
 
    regs_live_at_ip = rzalloc_array(mem_ctx, int, num_instructions);