r600/sfn: override register ID when it doesn't matter

When a vec4 register only uses constant value of ignore
swizzles then emit zero as register ID.

Optimizing the register use in instructions that support this type
of swizzle may lead to the situation that the RA doesn't see the
register ID, because it is actually irreleant, in this case return
zero as register ID to avoid that the assembler uselessly reports
a high requirement for registers based on a stale register ID.

Fixes: 79ca456b48
   r600/sfn: rewrite NIR backend

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18343>
This commit is contained in:
Gert Wollny 2022-08-31 08:13:18 +02:00 committed by Marge Bot
parent e9cff8ed7f
commit ed294e0863

View file

@ -433,7 +433,7 @@ int RegisterVec4::sel() const
int comp = 0;
while (comp < 4 && m_values[comp]->value()->chan() > 3)
++comp;
return m_values[comp < 4 ? comp : 0]->value()->sel();
return comp < 4 ? m_values[comp]->value()->sel() : 0;
}
bool RegisterVec4::ready(int block_id, int index) const