i965/fs: Call calculate_cfg() before optimize().
authorMatt Turner <mattst88@gmail.com>
Fri, 13 Feb 2015 18:34:39 +0000 (10:34 -0800)
committerMatt Turner <mattst88@gmail.com>
Sun, 15 Feb 2015 20:24:11 +0000 (12:24 -0800)
The CFG is fundamental to the FS IR, not merely a piece of optimization.

Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
src/mesa/drivers/dri/i965/brw_fs.cpp

index 0f1300c1cc6961f94324b83e0276fd30fe9216ec..a311266201ba3086e5cf58c9446a5f491b2cdb50 100644 (file)
@@ -3557,8 +3557,6 @@ fs_visitor::optimize()
 {
    const char *stage_name = stage == MESA_SHADER_VERTEX ? "vs" : "fs";
 
-   calculate_cfg();
-
    split_virtual_grfs();
 
    move_uniform_array_access_to_pull_constants();
@@ -3734,6 +3732,8 @@ fs_visitor::run_vs()
 
    emit_urb_writes();
 
+   calculate_cfg();
+
    optimize();
 
    assign_curb_setup();
@@ -3813,6 +3813,8 @@ fs_visitor::run_fs()
 
       emit_fb_writes();
 
+      calculate_cfg();
+
       optimize();
 
       assign_curb_setup();