ir3: fold shared movs into other movs

Handle cases like this in ir3_shared_fold:

cov.f32f16 sssa_1, c0.x
mov.u16u16 ssa_2, sssa_1
=>
cov.f32f16 ssa_1, c0.x

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32211>
This commit is contained in:
Job Noorman 2024-11-19 08:53:07 +01:00 committed by Marge Bot
parent 957db02fed
commit 86795a6337

View file

@ -72,6 +72,12 @@ try_shared_folding(struct ir3_instruction *mov, void *mem_ctx)
return false;
} else if (src->opc == OPC_LDC) {
src->flags &= ~IR3_INSTR_U;
} else if (src->opc == OPC_MOV) {
/* This catches cases like:
* cov.f32f16 sssa_1, c0.x
* mov.u16u16 ssa_2, sssa_1
* The cov can directly write to a non-shared reg.
*/
} else {
return false;
}