Module: Mesa
Branch: staging/23.0
Commit: d444199779f9945a8db23800e8f4d3ab891a1e10
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d444199779f9945a8db23800e8f4d3ab891a1e10

Author: Lionel Landwerlin <[email protected]>
Date:   Fri Mar 10 16:11:56 2023 +0200

intel/fs: don't SEND messages as partial writes

For instance, to load uniform data with the LSC we usually rely on
tranpose messages which have to execute in SIMD1. Those end up being
considered as partial writes so within loops their life span spread to
the whole loop, increasing register pressure.

Signed-off-by: Lionel Landwerlin <[email protected]>
Cc: mesa-stable
Reviewed-by: Kenneth Graunke <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21867>
(cherry picked from commit efde1917c933a293497e738616e18a91b02026d7)

---

 .pick_status.json             |  2 +-
 src/intel/compiler/brw_fs.cpp | 16 ++++++++++++----
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 48c118f286f..5b4abab6bd6 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -6277,7 +6277,7 @@
         "description": "intel/fs: don't SEND messages as partial writes",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null
     },
diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp
index dbd84968509..1df35f3568f 100644
--- a/src/intel/compiler/brw_fs.cpp
+++ b/src/intel/compiler/brw_fs.cpp
@@ -644,10 +644,18 @@ fs_visitor::limit_dispatch_width(unsigned n, const char 
*msg)
 bool
 fs_inst::is_partial_write() const
 {
-   return ((this->predicate && this->opcode != BRW_OPCODE_SEL) ||
-           (this->exec_size * type_sz(this->dst.type)) < 32 ||
-           !this->dst.is_contiguous() ||
-           this->dst.offset % REG_SIZE != 0);
+   if (this->predicate && this->opcode != BRW_OPCODE_SEL)
+      return true;
+
+   if (this->dst.offset % REG_SIZE != 0)
+      return true;
+
+   /* SEND instructions always write whole registers */
+   if (this->opcode == SHADER_OPCODE_SEND)
+      return false;
+
+   return this->exec_size * type_sz(this->dst.type) < 32 ||
+          !this->dst.is_contiguous();
 }
 
 unsigned

Reply via email to