Mesa (master): aco: also consider VCC in get_reg_specified()

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Feb 12 19:10:52 UTC 2021


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

Author: Daniel Schürmann <daniel at schuermann.dev>
Date:   Mon Feb  8 14:38:43 2021 +0100

aco: also consider VCC in get_reg_specified()

This allows split_vector and others to keep their VCC position.

Totals from 4573 (3.28% of 139391) affected shaders (Navi10):
CodeSize: 54292268 -> 54289324 (-0.01%); split: -0.03%, +0.03%
Instrs: 10327645 -> 10326941 (-0.01%); split: -0.04%, +0.04%
Cycles: 744410748 -> 744034732 (-0.05%); split: -0.07%, +0.02%
VMEM: 749093 -> 749092 (-0.00%); split: +0.00%, -0.00%
SMEM: 269306 -> 269322 (+0.01%)
SClause: 358746 -> 358744 (-0.00%)
Copies: 826051 -> 823910 (-0.26%); split: -0.55%, +0.29%
Branches: 355074 -> 356493 (+0.40%); split: -0.01%, +0.41%

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

---

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

diff --git a/src/amd/compiler/aco_register_allocation.cpp b/src/amd/compiler/aco_register_allocation.cpp
index 5b151d9429d..fa07606e16a 100644
--- a/src/amd/compiler/aco_register_allocation.cpp
+++ b/src/amd/compiler/aco_register_allocation.cpp
@@ -1227,7 +1227,10 @@ bool get_reg_specified(ra_ctx& ctx,
 
    PhysRegInterval reg_win = { reg, rc.size() };
    PhysRegInterval bounds = get_reg_bounds(ctx.program, rc.type());
-   if (!bounds.contains(reg_win))
+   PhysRegInterval vcc_win = { vcc, 2 };
+   /* VCC is outside the bounds */
+   bool is_vcc = rc.type() == RegType::sgpr && vcc_win.contains(reg_win);
+   if (!bounds.contains(reg_win) && !is_vcc)
       return false;
 
    if (rc.is_subdword()) {



More information about the mesa-commit mailing list