瀏覽代碼

aco: fix new_demand calculation for first instructions

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
tags/19.3-branchpoint
Rhys Perry 5 年之前
父節點
當前提交
e73de4e1d8
共有 1 個文件被更改,包括 7 次插入4 次删除
  1. 7
    4
      src/amd/compiler/aco_spill.cpp

+ 7
- 4
src/amd/compiler/aco_spill.cpp 查看文件

@@ -1033,11 +1033,14 @@ void process_block(spill_ctx& ctx, unsigned block_idx, Block* block,

RegisterDemand new_demand = ctx.register_demand[block_idx][idx];
if (idx == 0) {
for (const Definition& def : instr->definitions) {
if (!def.isTemp())
continue;
new_demand += def.getTemp();
RegisterDemand demand_before = new_demand;
for (const Definition& def : instr->definitions)
demand_before -= def.getTemp();
for (const Operand& op : instr->operands) {
if (op.isFirstKill())
demand_before += op.getTemp();
}
new_demand.update(demand_before);
} else {
new_demand.update(ctx.register_demand[block_idx][idx - 1]);
}

Loading…
取消
儲存