jay: predicate NoMask instructions in uniform IF's

Totals:
Instrs: 4742391 -> 4742257 (-0.00%)
CodeSize: 70245120 -> 70243520 (-0.00%); split: -0.00%, +0.00%

Totals from 81 (3.06% of 2647) affected shaders:
Instrs: 337727 -> 337593 (-0.04%)
CodeSize: 4992992 -> 4991392 (-0.03%); split: -0.03%, +0.00%

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41215>
This commit is contained in:
Alyssa Rosenzweig 2026-04-27 13:37:15 -04:00 committed by Marge Bot
parent f199f00564
commit 70d09d97ef

View file

@ -20,14 +20,14 @@ predicate_block(jay_builder *b,
*
* A few opcodes can't be predicated due to ISA restrictions.
*
* Predicating NoMask instructions doesn't work if we are electing a nonzero
* lane but the NoMask forces lane 0. This should be optimized later.
* Predicating NoMask instructions only works with UFLAGs (where we know lane
* 0 controls the flag and we're not electing some other lane).
*/
jay_foreach_inst_in_block(block, I) {
if (jay_uses_flag(I) ||
(I->op == JAY_OPCODE_MIN || I->op == JAY_OPCODE_MAX) ||
I->op == JAY_OPCODE_CSEL ||
jay_is_no_mask(I) ||
(condition.file != UFLAG && jay_is_no_mask(I)) ||
(--limit) < 0)
return false;
}