The parallel copy lowering has been able to handle uniform sources since
98f0ebf2647 ("agx:
Pass agx_index to agx_copy"), and uniform sources work fine with phis. It's not
super common but there's no need to restrict them. This is a small instruction
count win and will greatly simplify the lowering later in this series.
total instructions in shared programs: 1523806 -> 1523285 (-0.03%)
instructions in affected programs: 17088 -> 16567 (-3.05%)
helped: 38
HURT: 1
helped stats (abs) min: 1.0 max: 44.0 x̄: 13.95 x̃: 7
helped stats (rel) min: 0.42% max: 18.64% x̄: 4.73% x̃: 1.26%
HURT stats (abs) min: 9.0 max: 9.0 x̄: 9.00 x̃: 9
HURT stats (rel) min: 8.57% max: 8.57% x̄: 8.57% x̃: 8.57%
95% mean confidence interval for instructions value: -17.95 -8.77
95% mean confidence interval for instructions %-change: -6.35% -2.43%
Instructions are helped.
total bytes in shared programs:
10447658 ->
10444532 (-0.03%)
bytes in affected programs: 118850 -> 115724 (-2.63%)
helped: 38
HURT: 1
helped stats (abs) min: 6.0 max: 264.0 x̄: 83.68 x̃: 45
helped stats (rel) min: 0.36% max: 16.51% x̄: 4.14% x̃: 1.09%
HURT stats (abs) min: 54.0 max: 54.0 x̄: 54.00 x̃: 54
HURT stats (rel) min: 7.30% max: 7.30% x̄: 7.30% x̃: 7.30%
95% mean confidence interval for bytes value: -107.68 -52.62
95% mean confidence interval for bytes %-change: -5.55% -2.13%
Bytes are helped.
total halfregs in shared programs: 419446 -> 419444 (<.01%)
halfregs in affected programs: 29 -> 27 (-6.90%)
helped: 1
HURT: 0
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21122>
/* Make live the corresponding source */
agx_foreach_phi_in_block(blk, phi) {
agx_index operand = phi->src[agx_predecessor_index(blk, *pred)];
- assert(operand.type == AGX_INDEX_NORMAL);
- BITSET_SET(live, operand.value);
+ if (operand.type == AGX_INDEX_NORMAL)
+ BITSET_SET(live, operand.value);
}
bool progress = false;
(s != 0 || def->src[0].value >= 256)) ||
(I->op == AGX_OPCODE_DEVICE_STORE &&
(s != 1 || def->src[0].value >= 256)) ||
- I->op == AGX_OPCODE_PHI || I->op == AGX_OPCODE_ZS_EMIT ||
- I->op == AGX_OPCODE_ST_TILE || I->op == AGX_OPCODE_LD_TILE ||
+ I->op == AGX_OPCODE_ZS_EMIT || I->op == AGX_OPCODE_ST_TILE ||
+ I->op == AGX_OPCODE_LD_TILE ||
I->op == AGX_OPCODE_BLOCK_IMAGE_STORE ||
I->op == AGX_OPCODE_UNIFORM_STORE || I->op == AGX_OPCODE_ST_VARY))
continue;
agx_index src = phi->src[pred_index];
assert(dest.type == AGX_INDEX_REGISTER);
- assert(src.type == AGX_INDEX_REGISTER);
assert(dest.size == src.size);
copies[i++] = (struct agx_copy){