Mesa (staging/19.3): aco: fix off-by-one error when initializing sgpr_live_in
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Jan 23 22:40:48 UTC 2020
Module: Mesa
Branch: staging/19.3
Commit: ce33a18362e060b4f2b26b6f42c806d0ec588321
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ce33a18362e060b4f2b26b6f42c806d0ec588321
Author: Rhys Perry <pendingchaos02 at gmail.com>
Date: Wed Jan 22 11:51:31 2020 +0000
aco: fix off-by-one error when initializing sgpr_live_in
Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2394
Fixes: 93c8ebfa780 ('aco: Initial commit of independent AMD compiler')
Reviewed-by: Daniel Schürmann <daniel at schuermann.dev>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3511>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3511>
(cherry picked from commit 15a1cc00d38db084b41d7ae7907aa0b0c22f2099)
---
.pick_status.json | 2 +-
src/amd/compiler/aco_register_allocation.cpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.pick_status.json b/.pick_status.json
index 577b37af21c..1cb8ab98981 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -796,7 +796,7 @@
"description": "aco: fix off-by-one error when initializing sgpr_live_in",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"master_sha": null,
"because_sha": "93c8ebfa780ebd1495095e794731881aef29e7d3"
},
diff --git a/src/amd/compiler/aco_register_allocation.cpp b/src/amd/compiler/aco_register_allocation.cpp
index c4144cc42f0..ac6f9fc57c9 100644
--- a/src/amd/compiler/aco_register_allocation.cpp
+++ b/src/amd/compiler/aco_register_allocation.cpp
@@ -1347,7 +1347,7 @@ void register_allocation(Program *program, std::vector<std::set<Temp>> live_out_
}
/* fill in sgpr_live_in */
- for (unsigned i = 0; i < ctx.max_used_sgpr; i++)
+ for (unsigned i = 0; i <= ctx.max_used_sgpr; i++)
sgpr_live_in[block.index][i] = register_file[i];
sgpr_live_in[block.index][127] = register_file[scc.reg];
More information about the mesa-commit
mailing list