mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-02 13:10:25 +01:00
aco: Fix to_uniform_bool_instr when operands are not suitable.
Don't attempt to transform uniform boolean instructions when their operands are unsuitable. This can happen eg. due to other optimizations that combine SALU instructions which clear out the uniform instruction labels. Cc: mesa-stable Fixes:8a32f57fffSigned-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Daniel Schürmann <daniel@schuermann.dev> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11573> (cherry picked from commitabcc83e713)
This commit is contained in:
parent
554e47b603
commit
2f1bc2bb60
2 changed files with 9 additions and 1 deletions
|
|
@ -1435,7 +1435,7 @@
|
|||
"description": "aco: Fix to_uniform_bool_instr when operands are not suitable.",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "8a32f57fff56b3b94f1b5589feba38016f39427c"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -3577,6 +3577,14 @@ combine_instruction(opt_ctx& ctx, aco_ptr<Instruction>& instr)
|
|||
bool
|
||||
to_uniform_bool_instr(opt_ctx& ctx, aco_ptr<Instruction>& instr)
|
||||
{
|
||||
/* Check every operand to make sure they are suitable. */
|
||||
for (Operand& op : instr->operands) {
|
||||
if (!op.isTemp())
|
||||
return false;
|
||||
if (!ctx.info[op.tempId()].is_uniform_bool() && !ctx.info[op.tempId()].is_uniform_bitwise())
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (instr->opcode) {
|
||||
case aco_opcode::s_and_b32:
|
||||
case aco_opcode::s_and_b64: instr->opcode = aco_opcode::s_and_b32; break;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue