summaryrefslogtreecommitdiff
path: root/src/amd/compiler/aco_insert_waitcnt.cpp
diff options
context:
space:
mode:
authorRhys Perry <pendingchaos02@gmail.com>2021-01-20 15:27:16 +0000
committerMarge Bot <eric+marge@anholt.net>2021-01-22 14:12:32 +0000
commit1d245cd18b637484512f275b9bb49f05105ad373 (patch)
tree0a5557815d03bca52a20e46a8e383946e0ef5639 /src/amd/compiler/aco_insert_waitcnt.cpp
parent70dbcfa1c9e0b5fe609485b011c3ce9d0819a9ee (diff)
downloadmesa-1d245cd18b637484512f275b9bb49f05105ad373.tar.gz
aco: use format-check methods
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Daniel Schürmann <daniel@schuermann.dev> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8595>
Diffstat (limited to 'src/amd/compiler/aco_insert_waitcnt.cpp')
-rw-r--r--src/amd/compiler/aco_insert_waitcnt.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/amd/compiler/aco_insert_waitcnt.cpp b/src/amd/compiler/aco_insert_waitcnt.cpp
index 2f23fe2949e..2c5c115124e 100644
--- a/src/amd/compiler/aco_insert_waitcnt.cpp
+++ b/src/amd/compiler/aco_insert_waitcnt.cpp
@@ -416,16 +416,14 @@ wait_imm check_instr(Instruction* instr, wait_ctx& ctx)
continue;
/* Vector Memory reads and writes return in the order they were issued */
- bool has_sampler = instr->format == Format::MIMG && !instr->operands[1].isUndefined() && instr->operands[1].regClass() == s4;
+ bool has_sampler = instr->isMIMG() && !instr->operands[1].isUndefined() && instr->operands[1].regClass() == s4;
if (instr->isVMEM() && ((it->second.events & vm_events) == event_vmem) &&
it->second.has_vmem_nosampler == !has_sampler && it->second.has_vmem_sampler == has_sampler)
continue;
/* LDS reads and writes return in the order they were issued. same for GDS */
- if (instr->format == Format::DS) {
- if ((it->second.events & lgkm_events) == (instr->ds()->gds ? event_gds : event_lds))
- continue;
- }
+ if (instr->isDS() && (it->second.events & lgkm_events) == (instr->ds()->gds ? event_gds : event_lds))
+ continue;
wait.combine(it->second.imm);
}
@@ -515,7 +513,7 @@ wait_imm kill(Instruction* instr, wait_ctx& ctx, memory_sync_info sync_info)
imm.lgkm = 0;
}
- if (ctx.chip_class >= GFX10 && instr->format == Format::SMEM) {
+ if (ctx.chip_class >= GFX10 && instr->isSMEM()) {
/* GFX10: A store followed by a load at the same address causes a problem because
* the load doesn't load the correct values unless we wait for the store first.
* This is NOT mitigated by an s_nop.
@@ -832,7 +830,7 @@ void gen(Instruction* instr, wait_ctx& ctx)
wait_event ev = !instr->definitions.empty() || ctx.chip_class < GFX10 ? event_vmem : event_vmem_store;
update_counters(ctx, ev, get_sync_info(instr));
- bool has_sampler = instr->format == Format::MIMG && !instr->operands[1].isUndefined() && instr->operands[1].regClass() == s4;
+ bool has_sampler = instr->isMIMG() && !instr->operands[1].isUndefined() && instr->operands[1].regClass() == s4;
if (!instr->definitions.empty())
insert_wait_entry(ctx, instr->definitions[0], ev, has_sampler);
@@ -844,7 +842,7 @@ void gen(Instruction* instr, wait_ctx& ctx)
update_counters(ctx, event_vmem_gpr_lock);
insert_wait_entry(ctx, instr->operands[3], event_vmem_gpr_lock);
} else if (ctx.chip_class == GFX6 &&
- instr->format == Format::MIMG &&
+ instr->isMIMG() &&
!instr->operands[2].isUndefined()) {
ctx.exp_cnt++;
update_counters(ctx, event_vmem_gpr_lock);