r600/sfn: count LDS queue pop reads separately in assembler

Otherwise the check whether the fetches and reads are balanced
could fail.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17678>
This commit is contained in:
Gert Wollny 2022-07-21 17:52:05 +02:00 committed by Marge Bot
parent 233f246bdf
commit 8db31e0fe6
3 changed files with 14 additions and 7 deletions

View File

@ -309,7 +309,7 @@ void AssamblerVisitor::emit_alu_op(const AluInstr& ai)
alu.src[i].kc_rel = 1;
}
if (ai.has_lds_access()) {
if (ai.has_lds_queue_read()) {
assert(m_bc->cf_last->nlds_read > 0);
m_bc->cf_last->nlds_read--;
}

View File

@ -788,14 +788,20 @@ bool AluInstr::propagate_death()
bool AluInstr::has_lds_access() const
{
if (has_alu_flag(alu_is_lds))
return true;
return has_alu_flag(alu_is_lds) || has_lds_queue_read();
}
for (auto& s : m_src)
if (s->as_inline_const() &&
(s->as_inline_const()->sel() == ALU_SRC_LDS_OQ_A_POP))
bool AluInstr::has_lds_queue_read() const
{
for (auto& s : m_src) {
auto ic = s->as_inline_const();
if (!ic)
continue;
if (ic->sel() == ALU_SRC_LDS_OQ_A_POP ||
ic->sel() == ALU_SRC_LDS_OQ_B_POP)
return true;
}
return false;
}

View File

@ -127,6 +127,7 @@ public:
bool is_equal_to(const AluInstr& lhs) const;
bool has_lds_access() const;
bool has_lds_queue_read() const;
static const std::map<ECFAluOpCode, std::string> cf_map;
static const std::map<AluBankSwizzle, std::string> bank_swizzle_map;