From a8b93e628a21fd2a40b043cb33652b185b58ecfd Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Mon, 13 Jun 2022 15:29:15 -0700 Subject: [PATCH] intel/compiler: Handle split-sends in EOT high-register pinning case SEND messages with EOT need to use g112-g127 for their sources so that the hardware is able to launch new threads while old ones are finishing without worrying about register overlap when pushing payloads. For the newer split-send messages, this applies to both source registers. Our special case for this in the register allocator was only considering the first source. This wasn't a problem because we hadn't ever tried to use split-sends with EOT before. However, my new optimization pass is going to introduce some shortly, so we'll need to handle them properly. Reviewed-by: Francisco Jerez Part-of: --- src/intel/compiler/brw_fs_reg_allocate.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/intel/compiler/brw_fs_reg_allocate.cpp b/src/intel/compiler/brw_fs_reg_allocate.cpp index eb5db21eb00..cf37b5c4a9e 100644 --- a/src/intel/compiler/brw_fs_reg_allocate.cpp +++ b/src/intel/compiler/brw_fs_reg_allocate.cpp @@ -614,8 +614,7 @@ fs_reg_alloc::setup_inst_interference(const fs_inst *inst) if (inst->eot) { const int vgrf = inst->opcode == SHADER_OPCODE_SEND ? inst->src[2].nr : inst->src[0].nr; - int size = fs->alloc.sizes[vgrf]; - int reg = BRW_MAX_GRF - size; + int reg = BRW_MAX_GRF - fs->alloc.sizes[vgrf]; if (first_mrf_hack_node >= 0) { /* If something happened to spill, we want to push the EOT send @@ -631,6 +630,12 @@ fs_reg_alloc::setup_inst_interference(const fs_inst *inst) } ra_set_node_reg(g, first_vgrf_node + vgrf, reg); + + if (inst->ex_mlen > 0) { + const int vgrf = inst->src[3].nr; + reg -= fs->alloc.sizes[vgrf]; + ra_set_node_reg(g, first_vgrf_node + vgrf, reg); + } } }