elk/algebraic: Don't optimize float SEL.CMOD to MOV
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

Floating point SEL.CMOD may flush denorms to zero. We don't have enough
information at this point in compilation to know whether or not it is
safe to remove that.

Integer SEL or SEL without a conditional modifier is just a fancy
MOV. Those are always safe to eliminate.

See also 3f782cdd25.

Fixes: fab92fa1cb ("i965/fs: Optimize SEL with the same sources into a MOV.")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34192>
This commit is contained in:
Ian Romanick 2025-03-10 18:19:16 -07:00 committed by Marge Bot
parent f4ede9c10a
commit e783930b10

View file

@ -2397,7 +2397,9 @@ elk_fs_visitor::opt_algebraic()
inst->remove(block);
progress = true;
}
if (inst->src[0].equals(inst->src[1])) {
if (inst->src[0].equals(inst->src[1]) &&
(!elk_reg_type_is_floating_point(inst->dst.type) ||
inst->conditional_mod == ELK_CONDITIONAL_NONE)) {
inst->opcode = ELK_OPCODE_MOV;
inst->sources = 1;
inst->src[1] = reg_undef;