jay/opt_dead_code: handle predication

otherwise we'll get validation splat soon.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41064>
This commit is contained in:
Alyssa Rosenzweig 2026-04-15 14:31:25 -04:00 committed by Marge Bot
parent f63ab3eea5
commit 176b9a0f0c

View file

@ -4,6 +4,7 @@
*/
#include "util/bitset.h"
#include "jay_builder.h"
#include "jay_ir.h"
#include "jay_opcodes.h"
#include "jay_private.h"
@ -18,6 +19,12 @@ pass(jay_function *f)
if (!BITSET_TEST_COUNT(live_set, jay_base_index(I->dst),
jay_num_values(I->dst)) &&
I->op != JAY_OPCODE_SEND) {
if (I->predication == JAY_PREDICATED_DEFAULT && !jay_is_null(I->dst)) {
jay_shrink_sources(I, I->num_srcs - 1);
I->predication = JAY_PREDICATED;
}
I->dst = jay_null();
}