dst->mask[i] = a->mask[i] | b->mask[i];
}
+static inline void
+regmask_or_shared(regmask_t *dst, regmask_t *a, regmask_t *b)
+{
+ regmaskstate_t shared_mask;
+ BITSET_ZERO(shared_mask);
+
+ if (b->mergedregs) {
+ BITSET_SET_RANGE(shared_mask, 2 * 4 * 48, 2 * 4 * 56 - 1);
+ } else {
+ BITSET_SET_RANGE(shared_mask, 4 * 48, 4 * 56 - 1);
+ }
+
+ for (unsigned i = 0; i < ARRAY_SIZE(dst->mask); i++)
+ dst->mask[i] = a->mask[i] | (b->mask[i] & shared_mask[i]);
+}
static inline void
regmask_set(regmask_t *regmask, struct ir3_register *reg)
regmask_or(&state->needs_sy, &state->needs_sy, &pstate->needs_sy);
}
+ /* We need to take phsyical-only edges into account when tracking shared
+ * registers.
+ */
+ for (unsigned i = 0; i < block->physical_predecessors_count; i++) {
+ struct ir3_block *predecessor = block->physical_predecessors[i];
+ struct ir3_legalize_block_data *pbd = predecessor->data;
+ struct ir3_legalize_state *pstate = &pbd->state;
+
+ regmask_or_shared(&state->needs_ss, &state->needs_ss, &pstate->needs_ss);
+ }
+
unsigned input_count = 0;
foreach_instr (n, &block->instr_list) {