i965/fs: Fix vgrf0 live interval when no interpolation was done.
authorEric Anholt <eric@anholt.net>
Wed, 26 Mar 2014 17:06:53 +0000 (10:06 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 8 Apr 2014 07:59:48 +0000 (00:59 -0700)
When you've got a simple solid-color shader that doesn't generate
pixel_x/y interpolation, we were deciding that the first vgrf was both the
undefined pixel_x and pixel_y, and extending its live interval to avoid
the stride problem.  That tricked other optimization that tries to see if
a particular instruction is the last use of a variable.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp

index 615172992473683dfc90e8c7d2ac33705a3a68e2..c7b1f2513abf4170eea4f7143f6392e98b90c27a 100644 (file)
@@ -86,8 +86,10 @@ fs_live_variables::setup_one_read(bblock_t *block, fs_inst *inst,
     */
    int end_ip = ip;
    if (v->dispatch_width == 16 && (reg.stride == 0 ||
-                                   (v->pixel_x.reg == reg.reg ||
-                                    v->pixel_y.reg == reg.reg))) {
+                                   ((v->pixel_x.file == GRF &&
+                                     v->pixel_x.reg == reg.reg) ||
+                                    (v->pixel_y.file == GRF &&
+                                     v->pixel_y.reg == reg.reg)))) {
       end_ip++;
    }