From 625d8705f02e211e2733c3fe12845505725c37d4 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Tue, 11 Feb 2020 16:55:39 +0000 Subject: [PATCH] aco: don't stop scheduling at exports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows us to move v_cvt_pkrtz_f16_f32 instructions upwards, improving schedules and (somewhat unintentionally) moving the exports slightly closer together. Totals from affected shaders: SGPRS: 1030224 -> 1030248 (0.00 %) VGPRS: 794080 -> 794392 (0.04 %) Spilled SGPRs: 127117 -> 127117 (0.00 %) Spilled VGPRs: 0 -> 0 (0.00 %) Scratch size: 0 -> 0 (0.00 %) dwords per thread Code Size: 89028152 -> 89032312 (0.00 %) bytes LDS: 0 -> 0 (0.00 %) blocks Max Waves: 65252 -> 65219 (-0.05 %) SMEM score: 843808.00 -> 843918.00 (0.01 %) VMEM score: 5331687.00 -> 5397802.00 (1.24 %) SMEM clauses: 567659 -> 567655 (-0.00 %) VMEM clauses: 290715 -> 290716 (0.00 %) Instructions: 17143219 -> 17144259 (0.01 %) Cycles: 1098442808 -> 1098446968 (0.00 %) Signed-off-by: Rhys Perry Reviewed-by: Daniel Schürmann Tested-by: Marge Bot Part-of: --- src/amd/compiler/aco_scheduler.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/amd/compiler/aco_scheduler.cpp b/src/amd/compiler/aco_scheduler.cpp index 84b0fa10cad..146c1809577 100644 --- a/src/amd/compiler/aco_scheduler.cpp +++ b/src/amd/compiler/aco_scheduler.cpp @@ -571,7 +571,7 @@ void schedule_SMEM(sched_ctx& ctx, Block* block, bool can_move_down = true; HazardResult haz = perform_hazard_query(&hq, candidate.get()); - if (haz == hazard_fail_reorder_ds || haz == hazard_fail_spill || haz == hazard_fail_reorder_sendmsg || haz == hazard_fail_barrier) + if (haz == hazard_fail_reorder_ds || haz == hazard_fail_spill || haz == hazard_fail_reorder_sendmsg || haz == hazard_fail_barrier || haz == hazard_fail_export) can_move_down = false; else if (haz != hazard_success) break; @@ -620,7 +620,8 @@ void schedule_SMEM(sched_ctx& ctx, Block* block, if (found_dependency) { HazardResult haz = perform_hazard_query(&hq, candidate.get()); if (haz == hazard_fail_reorder_ds || haz == hazard_fail_spill || - haz == hazard_fail_reorder_sendmsg || haz == hazard_fail_barrier) + haz == hazard_fail_reorder_sendmsg || haz == hazard_fail_barrier || + haz == hazard_fail_export) is_dependency = true; else if (haz != hazard_success) break; @@ -711,7 +712,8 @@ void schedule_VMEM(sched_ctx& ctx, Block* block, HazardResult haz = perform_hazard_query(part_of_clause ? &clause_hq : &indep_hq, candidate.get()); if (haz == hazard_fail_reorder_ds || haz == hazard_fail_spill || - haz == hazard_fail_reorder_sendmsg || haz == hazard_fail_barrier) + haz == hazard_fail_reorder_sendmsg || haz == hazard_fail_barrier || + haz == hazard_fail_export) can_move_down = false; else if (haz != hazard_success) break; @@ -757,7 +759,7 @@ void schedule_VMEM(sched_ctx& ctx, Block* block, HazardResult haz = perform_hazard_query(&indep_hq, candidate.get()); if (haz == hazard_fail_reorder_ds || haz == hazard_fail_spill || haz == hazard_fail_reorder_vmem_smem || haz == hazard_fail_reorder_sendmsg || - haz == hazard_fail_barrier) + haz == hazard_fail_barrier || haz == hazard_fail_export) is_dependency = true; else if (haz != hazard_success) break; @@ -822,7 +824,7 @@ void schedule_position_export(sched_ctx& ctx, Block* block, break; HazardResult haz = perform_hazard_query(&hq, candidate.get()); - if (haz == hazard_fail_exec || haz == hazard_fail_export || haz == hazard_fail_memtime) + if (haz == hazard_fail_exec || haz == hazard_fail_memtime) break; if (haz != hazard_success) {