summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConnor Abbott <cwabbott0@gmail.com>2023-10-24 19:30:20 +0200
committerMarge Bot <emma+marge@anholt.net>2024-04-26 12:55:13 +0000
commit94c1ff415bdd109bfc52b8990c5aac9dd2b421b0 (patch)
tree351b41b437274ad164eac91851c2e8cb674db738
parenta64dd98e5502806dc78212ad309445593c87e5cc (diff)
ir3: Distinguish lowered shared->normal moves
When we use the scalar ALU we will start inserting moves with different API-level semantics from readInvocation() or readFirstInvocation(). We need to distinguish between these moves and lowered readInvocation() moves, to avoid unnecessarily keeping helper invocations alive when inserting (eq). Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22075>
-rw-r--r--src/freedreno/ir3/ir3.h10
-rw-r--r--src/freedreno/ir3/ir3_lower_subgroups.c1
2 files changed, 9 insertions, 2 deletions
diff --git a/src/freedreno/ir3/ir3.h b/src/freedreno/ir3/ir3.h
index 3d0607b32b3..642daf016a2 100644
--- a/src/freedreno/ir3/ir3.h
+++ b/src/freedreno/ir3/ir3.h
@@ -346,6 +346,13 @@ typedef enum ir3_instruction_flags {
IR3_INSTR_SHARED_SPILL = IR3_INSTR_MARK,
IR3_INSTR_UNUSED = BIT(17),
+
+ /* Used to indicate that a mov comes from a lowered READ_FIRST/READ_COND
+ * and may broadcast a helper invocation's value from a vector register to a
+ * shared register that may be read by other invocations. This factors into
+ * (eq) calculations.
+ */
+ IR3_INSTR_NEEDS_HELPERS = BIT(18),
} ir3_instruction_flags;
struct ir3_instruction {
@@ -1168,8 +1175,7 @@ uses_helpers(struct ir3_instruction *instr)
/* Catch lowered READ_FIRST/READ_COND. */
case OPC_MOV:
- return (instr->dsts[0]->flags & IR3_REG_SHARED) &&
- !(instr->srcs[0]->flags & IR3_REG_SHARED);
+ return instr->flags & IR3_INSTR_NEEDS_HELPERS;
default:
return false;
diff --git a/src/freedreno/ir3/ir3_lower_subgroups.c b/src/freedreno/ir3/ir3_lower_subgroups.c
index bd4048d63f4..224c459cd11 100644
--- a/src/freedreno/ir3/ir3_lower_subgroups.c
+++ b/src/freedreno/ir3/ir3_lower_subgroups.c
@@ -479,6 +479,7 @@ lower_instr(struct ir3 *ir, struct ir3_block **block, struct ir3_instruction *in
mov->cat1.dst_type = TYPE_U32;
mov->cat1.src_type =
(new_src->flags & IR3_REG_HALF) ? TYPE_U16 : TYPE_U32;
+ mov->flags |= IR3_INSTR_NEEDS_HELPERS;
break;
}