i965/fs: Simplify copy propagation LOAD_PAYLOAD ACP setup.
authorFrancisco Jerez <currojerez@riseup.net>
Fri, 2 Sep 2016 04:22:03 +0000 (21:22 -0700)
committerFrancisco Jerez <currojerez@riseup.net>
Wed, 14 Sep 2016 21:50:57 +0000 (14:50 -0700)
By keeping track of 'offset' in byte units.

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

index bd534bf65bfaff20b178a22d435d9d02c769bf01..0da5f13014f60bd391fa94b67772269b50d95da7 100644 (file)
@@ -818,8 +818,7 @@ fs_visitor::opt_copy_propagate_local(void *copy_prop_ctx, bblock_t *block,
                                           type_sz(inst->src[i].type);
             if (inst->src[i].file == VGRF) {
                acp_entry *entry = ralloc(copy_prop_ctx, acp_entry);
-               entry->dst = inst->dst;
-               entry->dst.offset += offset * REG_SIZE;
+               entry->dst = byte_offset(inst->dst, offset);
                entry->src = inst->src[i];
                entry->size_written = size_written;
                entry->size_read = inst->size_read(i);
@@ -830,7 +829,7 @@ fs_visitor::opt_copy_propagate_local(void *copy_prop_ctx, bblock_t *block,
                   ralloc_free(entry);
                }
             }
-            offset += DIV_ROUND_UP(size_written, REG_SIZE);
+            offset += size_written;
          }
       }
    }