r600/sfn: drop useless instr use count

This is handled with the dest registers

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21357>
This commit is contained in:
Gert Wollny 2023-01-28 18:27:02 +01:00 committed by Marge Bot
parent ac6b95d40b
commit b1df8b0393
2 changed files with 1 additions and 20 deletions

View file

@ -98,16 +98,9 @@ public:
m_instr_flags.set(scheduled);
forward_set_scheduled();
}
void add_use() { ++m_use_count; }
void dec_use()
{
assert(m_use_count > 0);
--m_use_count;
}
bool is_dead() const { return m_instr_flags.test(dead); }
bool is_scheduled() const { return m_instr_flags.test(scheduled); }
bool keep() const { return m_instr_flags.test(always_keep); }
bool has_uses() const { return m_use_count > 0; }
bool has_instr_flag(Flags f) const { return m_instr_flags.test(f); }
void set_instr_flag(Flags f) { m_instr_flags.set(f); }

View file

@ -198,7 +198,6 @@ void
Register::add_parent(Instr *instr)
{
m_parents.insert(instr);
instr->add_use();
add_parent_to_array(instr);
}
@ -212,7 +211,6 @@ void
Register::del_parent(Instr *instr)
{
m_parents.erase(instr);
instr->dec_use();
del_parent_from_array(instr);
}
@ -225,14 +223,7 @@ Register::del_parent_from_array(Instr *instr)
void
Register::add_use(Instr *instr)
{
const auto& [itr, inserted] = m_uses.insert(instr);
{
}
if (inserted) {
for (auto& p : m_parents)
p->add_use();
}
m_uses.insert(instr);
}
void
@ -241,9 +232,6 @@ Register::del_use(Instr *instr)
sfn_log << SfnLog::opt << "Del use of " << *this << " in " << *instr << "\n";
if (m_uses.find(instr) != m_uses.end()) {
m_uses.erase(instr);
if (m_flags.test(ssa))
for (auto& p : m_parents)
p->dec_use();
}
}