Commit b4bc657d authored by Rhys Perry's avatar Rhys Perry Committed by Daniel Schürmann
Browse files

aco: move VMEM instructions below descriptor loads



This is to prevent sequences like:
   a = descriptor_load()
   vmem(a)
   b = descriptor_load()
   vmem(b)
and instead create:
   a = descriptor_load()
   b = descriptor_load()
   vmem(a)
   vmem(b)

fossil-db (Navi):
Totals from 108732 (78.34% of 138791) affected shaders:
SGPRs: 5813529 -> 6320493 (+8.72%); split: -0.12%, +8.84%
VGPRs: 4157736 -> 4157752 (+0.00%); split: -0.03%, +0.03%
CodeSize: 265292988 -> 264014500 (-0.48%); split: -0.51%, +0.02%
MaxWaves: 1560741 -> 1560968 (+0.01%); split: +0.02%, -0.01%
Instrs: 51206869 -> 50885773 (-0.63%); split: -0.66%, +0.03%
Cycles: 1729367212 -> 1727750068 (-0.09%); split: -0.10%, +0.00%
VMEM: 42553651 -> 39970550 (-6.07%); split: +0.12%, -6.19%
SMEM: 7068340 -> 8045390 (+13.82%); split: +15.45%, -1.63%
VClause: 1123189 -> 1123518 (+0.03%); split: -0.54%, +0.57%
SClause: 2157376 -> 2055942 (-4.70%); split: -5.46%, +0.76%
Copies: 3820367 -> 3835023 (+0.38%); split: -0.19%, +0.57%
Branches: 1115624 -> 1115629 (+0.00%); split: -0.00%, +0.00%
Signed-off-by: Rhys Perry's avatarRhys Perry <pendingchaos02@gmail.com>
parent b037c5d7
Pipeline #268209 waiting for manual action with stages
......@@ -637,7 +637,8 @@ void schedule_SMEM(sched_ctx& ctx, Block* block,
/* break when encountering another MEM instruction, logical_start or barriers */
if (candidate->opcode == aco_opcode::p_logical_start)
break;
if (candidate->isVMEM())
/* only move VMEM instructions below descriptor loads */
if (candidate->isVMEM() && (ctx.mv.insert_idx - candidate_idx > 6 || current->operands[0].size() == 4))
break;
/* don't move descriptor loads below buffer loads */
if (candidate->format == Format::SMEM && current->operands[0].size() == 4 && candidate->operands[0].size() == 2)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment