freedreno/ir3: split out has_latency_to_hide()
authorRob Clark <robdclark@chromium.org>
Fri, 28 Feb 2020 20:47:29 +0000 (12:47 -0800)
committerMarge Bot <eric+marge@anholt.net>
Tue, 10 Mar 2020 16:01:39 +0000 (16:01 +0000)
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4071>

src/freedreno/ir3/ir3.h
src/freedreno/ir3/ir3_sched.c

index 1a3edbc45309363e45531c52c1351484b93515a4..a44663f4238b16615aeeee20bfc5faa81cf1ec82 100644 (file)
@@ -1198,6 +1198,30 @@ int ir3_ra(struct ir3_shader_variant *v, struct ir3_instruction **precolor, unsi
 /* legalize: */
 void ir3_legalize(struct ir3 *ir, struct ir3_shader_variant *so, int *max_bary);
 
+static inline bool
+ir3_has_latency_to_hide(struct ir3 *ir)
+{
+       foreach_block (block, &ir->block_list) {
+               foreach_instr (instr, &block->instr_list) {
+                       if (is_tex(instr))
+                               return true;
+
+                       if (is_load(instr)) {
+                               switch (instr->opc) {
+                               case OPC_LDLV:
+                               case OPC_LDL:
+                               case OPC_LDLW:
+                                       break;
+                               default:
+                                       return true;
+                               }
+                       }
+               }
+       }
+
+       return false;
+}
+
 /* ************************************************************************* */
 /* instruction helpers */
 
index 9c8d3572a23100b4ed92512b45e52e1ba4843e7d..d48fd497b745efdbb0f6c5201191ade6155e7657 100644 (file)
@@ -772,34 +772,10 @@ sched_block(struct ir3_sched_ctx *ctx, struct ir3_block *block)
        }
 }
 
-static bool
-has_latency_to_hide(struct ir3 *ir)
-{
-       foreach_block (block, &ir->block_list) {
-               foreach_instr (instr, &block->instr_list) {
-                       if (is_tex(instr))
-                               return true;
-
-                       if (is_load(instr)) {
-                               switch (instr->opc) {
-                               case OPC_LDLV:
-                               case OPC_LDL:
-                               case OPC_LDLW:
-                                       break;
-                               default:
-                                       return true;
-                               }
-                       }
-               }
-       }
-
-       return false;
-}
-
 static void
 setup_thresholds(struct ir3_sched_ctx *ctx, struct ir3 *ir)
 {
-       if (has_latency_to_hide(ir)) {
+       if (ir3_has_latency_to_hide(ir)) {
                ctx->live_threshold_hi = 2 * 16 * 4;
                ctx->live_threshold_lo = 2 * 4 * 4;
                ctx->depth_threshold_hi = 6;