Mesa (staging/22.0): radeonsi: limit loop unrolling for LLVM < 13

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Feb 3 21:05:37 UTC 2022


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

Author: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Date:   Thu Feb  3 09:35:07 2022 +0100

radeonsi: limit loop unrolling for LLVM < 13

Without this change LLVM 12 hits this error:

"""
LLVM ERROR: Error while trying to spill SGPR0_SGPR1 from class SReg_64:
Cannot scavenge register without an emergency spill slot!
"""

when running glcts KHR-GL46.arrays_of_arrays_gl.AtomicUsage test.

Fixes: 9ff086052ab ("radeonsi: unroll loops of up to 128 iterations")
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14848>
(cherry picked from commit eaa87b1a4659c1c06b0ac9e5659943c888dff6d3)

---

 .pick_status.json                     | 2 +-
 src/gallium/drivers/radeonsi/si_get.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 20718c7f8bf..b97ba0008ec 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -139,7 +139,7 @@
         "description": "radeonsi: limit loop unrolling for LLVM < 13",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "9ff086052ab7bff3cb55c06365543190a3afe188"
     },
diff --git a/src/gallium/drivers/radeonsi/si_get.c b/src/gallium/drivers/radeonsi/si_get.c
index 795461a1c90..985daa1c776 100644
--- a/src/gallium/drivers/radeonsi/si_get.c
+++ b/src/gallium/drivers/radeonsi/si_get.c
@@ -1072,8 +1072,8 @@ void si_init_screen_get_functions(struct si_screen *sscreen)
       .has_udot_4x8 = sscreen->info.has_accelerated_dot_product,
       .has_dot_2x16 = sscreen->info.has_accelerated_dot_product,
       .optimize_sample_mask_in = true,
-      .max_unroll_iterations = 128,
-      .max_unroll_iterations_aggressive = 128,
+      .max_unroll_iterations = LLVM_VERSION_MAJOR >= 13 ? 128 : 32,
+      .max_unroll_iterations_aggressive = LLVM_VERSION_MAJOR >= 13 ? 128 : 32,
       .use_interpolated_input_intrinsics = true,
       .lower_uniforms_to_ubo = true,
       .support_16bit_alu = sscreen->options.fp16,



More information about the mesa-commit mailing list