i965/fs: Add missing analysis invalidation in opt_sampler_eot().
authorFrancisco Jerez <currojerez@riseup.net>
Fri, 11 Mar 2016 23:22:56 +0000 (15:22 -0800)
committerFrancisco Jerez <currojerez@riseup.net>
Mon, 14 Mar 2016 21:56:02 +0000 (14:56 -0700)
Bug found by the liveness analysis validation pass that will be
introduced in a later commit.  opt_sampler_eot() was allocating
registers and inserting and removing instructions, which makes the
cached liveness analysis calculation inconsistent with the shader IR,
so it must be invalidated.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_fs.cpp

index ff67cf425339527e1aea3b95f15d74570027d59b..42bc5e2a0270303b713246a2ff1affc0a23db559 100644 (file)
@@ -2441,8 +2441,10 @@ fs_visitor::opt_sampler_eot()
     * we have enough space, but it will make sure the dead code eliminator kills
     * the instruction that this will replace.
     */
-   if (tex_inst->header_size != 0)
+   if (tex_inst->header_size != 0) {
+      invalidate_live_intervals();
       return true;
+   }
 
    fs_reg send_header = ibld.vgrf(BRW_REGISTER_TYPE_F,
                                   load_payload->sources + 1);
@@ -2473,6 +2475,7 @@ fs_visitor::opt_sampler_eot()
    tex_inst->insert_before(cfg->blocks[cfg->num_blocks - 1], new_load_payload);
    tex_inst->src[0] = send_header;
 
+   invalidate_live_intervals();
    return true;
 }