Mesa (main): intel/compiler: Handle split-sends in EOT high-register pinning case

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jul 1 02:30:18 UTC 2022


Module: Mesa
Branch: main
Commit: a8b93e628a21fd2a40b043cb33652b185b58ecfd
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a8b93e628a21fd2a40b043cb33652b185b58ecfd

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Mon Jun 13 15:29:15 2022 -0700

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 <currojerez at riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17018>

---

 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);
+      }
    }
 }
 



More information about the mesa-commit mailing list