From b23a9dd1f63684d1a19f58b808a1fe3c3dbca7ab Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Thu, 5 Aug 2021 11:42:39 +0100 Subject: [PATCH] aco/scheduler: allow moving down VMEM stores to below VMEM loads MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fossil-db (Vega10): Totals from 93 (0.06% of 150305) affected shaders: SGPRs: 4832 -> 4768 (-1.32%) VGPRs: 4084 -> 4144 (+1.47%) CodeSize: 316080 -> 317208 (+0.36%); split: -0.11%, +0.47% MaxWaves: 589 -> 580 (-1.53%) Instrs: 60229 -> 60511 (+0.47%); split: -0.15%, +0.61% Latency: 636477 -> 540029 (-15.15%); split: -15.26%, +0.10% InvThroughput: 293027 -> 283043 (-3.41%); split: -4.21%, +0.80% VClause: 2557 -> 2716 (+6.22%); split: -0.35%, +6.57% SClause: 1381 -> 1395 (+1.01%); split: -0.14%, +1.16% Copies: 9424 -> 9728 (+3.23%); split: -0.74%, +3.97% fossil-db (Sienna Cichlid): Totals from 88 (0.06% of 150170) affected shaders: VGPRs: 3840 -> 3872 (+0.83%) CodeSize: 300544 -> 300960 (+0.14%); split: -0.09%, +0.23% Instrs: 53714 -> 53871 (+0.29%); split: -0.05%, +0.35% Latency: 489854 -> 462001 (-5.69%); split: -6.30%, +0.61% InvThroughput: 100307 -> 95142 (-5.15%); split: -5.50%, +0.35% VClause: 2322 -> 2564 (+10.42%); split: -0.39%, +10.81% SClause: 1345 -> 1358 (+0.97%); split: -0.15%, +1.12% Copies: 4113 -> 4351 (+5.79%); split: -0.66%, +6.44% Signed-off-by: Rhys Perry Reviewed-by: Daniel Schürmann Part-of: --- src/amd/compiler/aco_scheduler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/amd/compiler/aco_scheduler.cpp b/src/amd/compiler/aco_scheduler.cpp index 9b4c9ffa48c..2f72ba0cc96 100644 --- a/src/amd/compiler/aco_scheduler.cpp +++ b/src/amd/compiler/aco_scheduler.cpp @@ -826,7 +826,7 @@ schedule_VMEM(sched_ctx& ctx, Block* block, std::vector& registe } /* if current depends on candidate, add additional dependencies and continue */ - bool can_move_down = !is_vmem || part_of_clause; + bool can_move_down = !is_vmem || part_of_clause || candidate->definitions.empty(); HazardResult haz = perform_hazard_query(part_of_clause ? &clause_hq : &indep_hq, candidate.get(), false);