diff --git a/src/amd/compiler/aco_scheduler.cpp b/src/amd/compiler/aco_scheduler.cpp index 69845cc5a9b..20a08ac7636 100644 --- a/src/amd/compiler/aco_scheduler.cpp +++ b/src/amd/compiler/aco_scheduler.cpp @@ -1033,9 +1033,9 @@ schedule_VMEM_store(sched_ctx& ctx, Block* block, std::vector& r init_hazard_query(ctx, &hq); DownwardsCursor cursor = ctx.mv.downwards_init(idx, true, true); - unsigned skip = 0; + int skip = 0; - for (int i = 0; i < VMEM_CLAUSE_MAX_GRAB_DIST; i++) { + for (int i = 0; (i - skip) < VMEM_CLAUSE_MAX_GRAB_DIST; i++) { aco_ptr& candidate = block->instructions[cursor.source_idx]; if (candidate->opcode == aco_opcode::p_logical_start) break;