pan/midgard: Extend liveness analysis to trinary ops
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 9 Aug 2019 17:40:01 +0000 (10:40 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 12 Aug 2019 19:43:03 +0000 (12:43 -0700)
Fixes RA fails with multiple indirect SSBO writes.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/panfrost/midgard/midgard_ra.c

index a669168eba456629500401b532040e3c53d13db3..a44d342c205072107a6c8cb048d59d606b89d13a 100644 (file)
@@ -636,12 +636,8 @@ allocate_registers(compiler_context *ctx, bool *spilled)
                          * invocations, and if there are none, the source dies
                          * */
 
-                        int sources[2] = {
-                                ins->ssa_args.src[0], ins->ssa_args.src[1]
-                        };
-
-                        for (int src = 0; src < 2; ++src) {
-                                int s = sources[src];
+                        for (int src = 0; src < ARRAY_SIZE(ins->ssa_args.src); ++src) {
+                                int s = ins->ssa_args.src[src];
 
                                 if (s < 0) continue;