From: Francisco Jerez Date: Sat, 28 Dec 2019 00:08:04 +0000 (-0800) Subject: intel/fs/gen8+: Fix r127 dst/src overlap RA workaround for EOT message payload. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0703eab0120f20451e75ba8d4ce065350ad36fef;p=mesa.git intel/fs/gen8+: Fix r127 dst/src overlap RA workaround for EOT message payload. The problem occured when the return payload of a SIMD8 SEND instruction was re-used as source payload of an EOT SEND message. In such cases the interference edge added by that workaround between the payload and grf127_send_hack_node would have no effect, because the payload would be allocated to a fixed range of registers containing r127 by the special handling of EOT message payloads in the same function. This would cause things to blow up if the source payload of the first SIMD8 message ended up being allocated to a range which happened to overlap the destination. Fix it by avoiding r127 altogether in the allocation of EOT message payloads. The problem can be reproduced on ICL with the fp-indirections2 Piglit test-case in combination with the other optimizer changes of this series. Fixes: 232ed8980217 "i965/fs: Register allocator shoudn't use grf127 for sends dest" Cc: Jason Ekstrand Reviewed-by: Kenneth Graunke --- diff --git a/src/intel/compiler/brw_fs_reg_allocate.cpp b/src/intel/compiler/brw_fs_reg_allocate.cpp index 6a594a4f520..bf3f86b0d56 100644 --- a/src/intel/compiler/brw_fs_reg_allocate.cpp +++ b/src/intel/compiler/brw_fs_reg_allocate.cpp @@ -683,12 +683,18 @@ fs_reg_alloc::setup_inst_interference(fs_inst *inst) int size = fs->alloc.sizes[vgrf]; int reg = compiler->fs_reg_sets[rsi].class_to_ra_reg_range[size] - 1; - /* If something happened to spill, we want to push the EOT send - * register early enough in the register file that we don't - * conflict with any used MRF hack registers. - */ - if (first_mrf_hack_node >= 0) + if (first_mrf_hack_node >= 0) { + /* If something happened to spill, we want to push the EOT send + * register early enough in the register file that we don't + * conflict with any used MRF hack registers. + */ reg -= BRW_MAX_MRF(devinfo->gen) - spill_base_mrf(fs); + } else if (grf127_send_hack_node >= 0) { + /* Avoid r127 which might be unusable if the node was previously + * written by a SIMD8 SEND message with source/destination overlap. + */ + reg--; + } ra_set_node_reg(g, first_vgrf_node + vgrf, reg); }