Will enable DCE of atomics.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9105>
if (tuple->add) {
bi_instr *add = tuple->add;
- bool sr_write = bi_opcode_props[add->op].sr_write;
+ bool sr_write = bi_opcode_props[add->op].sr_write &&
+ !bi_is_null(add->dest[0]);
- if (sr_read) {
+ if (sr_read && !bi_is_null(add->src[0])) {
assert(add->src[0].type == BI_INDEX_REGISTER);
clause->staging_register = add->src[0].value;