i965/fs: Compare full register offsets in cmod propagation pass.
authorFrancisco Jerez <currojerez@riseup.net>
Fri, 2 Sep 2016 04:16:14 +0000 (21:16 -0700)
committerFrancisco Jerez <currojerez@riseup.net>
Wed, 14 Sep 2016 21:50:55 +0000 (14:50 -0700)
This could potentially have misoptimized a program in cases where
inst->src[0] had a non-zero sub-GRF offset.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
src/mesa/drivers/dri/i965/brw_fs_cmod_propagation.cpp

index 7607d201bcb4d5b7566bba6e0e66d6a4210f413c..291ae4c24d23a3da0ca976d4c1cabc51db32a5e5 100644 (file)
@@ -90,8 +90,7 @@ opt_cmod_propagation_local(const gen_device_info *devinfo, bblock_t *block)
       foreach_inst_in_block_reverse_starting_from(fs_inst, scan_inst, inst) {
          if (scan_inst->overwrites_reg(inst->src[0])) {
             if (scan_inst->is_partial_write() ||
-                scan_inst->dst.offset / REG_SIZE !=
-                 inst->src[0].offset / REG_SIZE ||
+                scan_inst->dst.offset != inst->src[0].offset ||
                 scan_inst->exec_size != inst->exec_size)
                break;