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

Author: Lionel Landwerlin <[email protected]>
Date:   Fri Mar 24 13:56:06 2023 +0200

intel/fs: UNDEF fixup_nomask_control_flow temp register

Ensure that the register's liveness is not expanded to loops.

Signed-off-by: Lionel Landwerlin <[email protected]>
Cc: mesa-stable
Reviewed-by: Francisco Jerez <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21853>

---

 src/intel/compiler/brw_fs.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp
index ceeac3db004..8a435166858 100644
--- a/src/intel/compiler/brw_fs.cpp
+++ b/src/intel/compiler/brw_fs.cpp
@@ -6445,10 +6445,12 @@ fs_visitor::fixup_nomask_control_flow()
                 */
                const bool save_flag = flag_liveout &
                                       flag_mask(flag, dispatch_width / 8);
-               const fs_reg tmp = ubld.group(1, 0).vgrf(flag.type);
+               const fs_reg tmp = ubld.group(8, 0).vgrf(flag.type);
 
-               if (save_flag)
+               if (save_flag) {
+                  ubld.group(8, 0).UNDEF(tmp);
                   ubld.group(1, 0).MOV(tmp, flag);
+               }
 
                ubld.emit(FS_OPCODE_LOAD_LIVE_CHANNELS);
 

Reply via email to