From: Francisco Jerez Date: Fri, 2 Sep 2016 05:08:29 +0000 (-0700) Subject: i965/vec4: Don't coalesce registers with overlapping writes not matching the MOV... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3a74e437fdec02c28749c94bc1bcf21c3c4b48d7;p=mesa.git i965/vec4: Don't coalesce registers with overlapping writes not matching the MOV source. In preparation for adding support for sub-GRF offsets to the VEC4 IR. Reviewed-by: Iago Toral Quiroga --- diff --git a/src/mesa/drivers/dri/i965/brw_vec4.cpp b/src/mesa/drivers/dri/i965/brw_vec4.cpp index d9dbc4c8543..8f8d2623416 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4.cpp @@ -1181,8 +1181,11 @@ vec4_visitor::opt_register_coalesce() break; } - /* This doesn't handle coalescing of multiple registers. */ - if (scan_inst->size_written > REG_SIZE) + /* This only handles coalescing of a single register starting at + * the source offset of the copy instruction. + */ + if (scan_inst->size_written > REG_SIZE || + scan_inst->dst.offset != inst->src[0].offset) break; /* Mark which channels we found unconditional writes for. */ @@ -1246,8 +1249,7 @@ vec4_visitor::opt_register_coalesce() while (scan_inst != inst) { if (scan_inst->dst.file == VGRF && scan_inst->dst.nr == inst->src[0].nr && - scan_inst->dst.offset / REG_SIZE == - inst->src[0].offset / REG_SIZE) { + scan_inst->dst.offset == inst->src[0].offset) { scan_inst->reswizzle(inst->dst.writemask, inst->src[0].swizzle); scan_inst->dst.file = inst->dst.file;