aco: don't schedule instructions through depending VMEM instructions
authorDaniel Schürmann <daniel@schuermann.dev>
Thu, 10 Oct 2019 14:31:40 +0000 (16:31 +0200)
committerRhys Perry <pendingchaos02@gmail.com>
Wed, 30 Oct 2019 16:12:10 +0000 (16:12 +0000)
Previously, the scheduler tried to move up instructions from below depending
VMEM instructions only to move them down again when scheduling the VMEM
instruction.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
src/amd/compiler/aco_scheduler.cpp

index 30a82e68ce8d3c7f03a02d001214d98d296c545a..14f0f71385a41e10ac166600295471693a6f9636 100644 (file)
@@ -336,6 +336,9 @@ void schedule_SMEM(sched_ctx& ctx, Block* block,
       /* check if candidate depends on current */
       bool is_dependency = std::any_of(candidate->operands.begin(), candidate->operands.end(),
                                        [&ctx](const Operand& op) { return op.isTemp() && ctx.depends_on[op.tempId()];});
+      /* no need to steal from following VMEM instructions */
+      if (is_dependency && candidate->isVMEM())
+         break;
       if (moving_spill && is_spill_reload(candidate))
          is_dependency = true;
       if ((moving_interaction & barrier_shared) && candidate->format == Format::DS)