OSDN Git Service

aco: fix off-by-one error when initializing sgpr_live_in
authorRhys Perry <pendingchaos02@gmail.com>
Wed, 22 Jan 2020 11:51:31 +0000 (11:51 +0000)
committerDylan Baker <dylan@pnwbakers.com>
Tue, 28 Jan 2020 16:54:25 +0000 (08:54 -0800)
Signed-off-by: Rhys Perry <pendingchaos02@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@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
src/amd/compiler/aco_register_allocation.cpp

index 996507a..81371f4 100644 (file)
         "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"
     },
index c4144cc..ac6f9fc 100644 (file)
@@ -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];