summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/vc4/vc4_opt_dead_code.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gallium/drivers/vc4/vc4_opt_dead_code.c b/src/gallium/drivers/vc4/vc4_opt_dead_code.c
index d3562ee947e..ad51ed779ea 100644
--- a/src/gallium/drivers/vc4/vc4_opt_dead_code.c
+++ b/src/gallium/drivers/vc4/vc4_opt_dead_code.c
@@ -86,8 +86,9 @@ qir_opt_dead_code(struct vc4_compile *c)
list_for_each_entry_safe_rev(struct qinst, inst, &c->instructions,
link) {
- if (inst->dst.file == QFILE_TEMP &&
- !used[inst->dst.index] &&
+ if ((inst->dst.file == QFILE_NULL ||
+ (inst->dst.file == QFILE_TEMP &&
+ !used[inst->dst.index])) &&
!inst->sf &&
!qir_has_side_effects(c, inst) &&
!has_nonremovable_reads(c, inst)) {