r600/sfn: override slot count for IfInstr

We have one slot for the predicate (todo fix this value)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24297>
This commit is contained in:
Gert Wollny 2023-07-21 17:00:06 +02:00 committed by Marge Bot
parent c517defbdd
commit bd7a9b7f4e
2 changed files with 12 additions and 0 deletions

View file

@ -152,6 +152,16 @@ IfInstr::is_equal_to(const IfInstr& rhs) const
return m_predicate->equal_to(*rhs.m_predicate);
}
uint32_t IfInstr::slots() const
{
/* If we hava a literal value in the predicate evaluation, then
* we need at most two alu slots, otherwise it's just one. */
for (auto s : m_predicate->sources())
if (s->as_literal())
return 2;
return 1;
};
void
IfInstr::accept(ConstInstrVisitor& visitor) const
{

View file

@ -82,6 +82,8 @@ public:
AluInstr *predicate() const { return m_predicate; }
AluInstr *predicate() { return m_predicate; }
uint32_t slots() const override;
void accept(ConstInstrVisitor& visitor) const override;
void accept(InstrVisitor& visitor) override;