freedreno/ir3: legalize cleanups
authorRob Clark <robdclark@chromium.org>
Sun, 10 Nov 2019 18:49:59 +0000 (10:49 -0800)
committerRob Clark <robdclark@chromium.org>
Tue, 12 Nov 2019 21:57:52 +0000 (13:57 -0800)
We can clear the "needs" flags once we emit a flag.  And also, don't
open-code the opcode name.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/freedreno/ir3/ir3_legalize.c

index a7c41b3..4470eab 100644 (file)
@@ -134,10 +134,16 @@ legalize_block(struct ir3_legalize_ctx *ctx, struct ir3_block *block)
                if (last_n && is_barrier(last_n)) {
                        n->flags |= IR3_INSTR_SS | IR3_INSTR_SY;
                        last_input_needs_ss = false;
+                       regmask_init(&state->needs_ss_war);
+                       regmask_init(&state->needs_ss);
+                       regmask_init(&state->needs_sy);
                }
 
-               if (last_n && opc_cat(last_n->opc) == 0 && opc_op(last_n->opc) == 13)
+               if (last_n && (last_n->opc == OPC_CONDEND)) {
                        n->flags |= IR3_INSTR_SS;
+                       regmask_init(&state->needs_ss_war);
+                       regmask_init(&state->needs_ss);
+               }
 
                /* NOTE: consider dst register too.. it could happen that
                 * texture sample instruction (for example) writes some