Mesa (main): aco/ra: don't allocate vector space for MIMG NSA operands

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jul 21 09:55:19 UTC 2021


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

Author: Daniel Schürmann <daniel at schuermann.dev>
Date:   Tue Jul 20 11:12:26 2021 +0200

aco/ra: don't allocate vector space for MIMG NSA operands

In this case, the MIMG vaddr components are not vector-aligned anymore, anyway.

Totals from 11866 (7.90% of 150170) affected shaders: (GFX10.3)
VGPRs: 733064 -> 728408 (-0.64%); split: -0.66%, +0.02%
CodeSize: 67968356 -> 67968440 (+0.00%); split: -0.02%, +0.02%
MaxWaves: 214022 -> 214014 (-0.00%)
Instrs: 12798200 -> 12797232 (-0.01%); split: -0.02%, +0.01%
Latency: 196427665 -> 196418706 (-0.00%); split: -0.02%, +0.01%
InvThroughput: 37082037 -> 37080799 (-0.00%); split: -0.02%, +0.02%
VClause: 246097 -> 246031 (-0.03%); split: -0.16%, +0.13%
Copies: 494852 -> 493923 (-0.19%); split: -0.52%, +0.34%
Branches: 220323 -> 220294 (-0.01%); split: -0.03%, +0.02%

Reviewed-by: Rhys Perry <pendingchaos02 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11980>

---

 src/amd/compiler/aco_register_allocation.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/amd/compiler/aco_register_allocation.cpp b/src/amd/compiler/aco_register_allocation.cpp
index 3ec0b21db48..3e7e87e4ad2 100644
--- a/src/amd/compiler/aco_register_allocation.cpp
+++ b/src/amd/compiler/aco_register_allocation.cpp
@@ -1454,6 +1454,10 @@ get_reg_vector(ra_ctx& ctx, RegisterFile& reg_file, Temp temp, aco_ptr<Instructi
             reg.reg_b += (our_offset - their_offset);
             if (get_reg_specified(ctx, reg_file, temp.regClass(), instr, reg))
                return {reg, true};
+
+            /* return if MIMG vaddr components don't remain vector-aligned */
+            if (vec->format == Format::MIMG)
+               return {{}, false};
          }
          their_offset += op.bytes();
       }



More information about the mesa-commit mailing list