Trivially computed during liveness analysis (already a byproduct!) and required
for efficient register allocation.
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
typedef struct {
/* Sufficient for as many SSA values as we need. Immediates and uniforms fit in 16-bits */
- unsigned value : 23;
+ unsigned value : 22;
+
+ /* Indicates that this source kills the referenced value (because it is the
+ * last use in a block and the source is not live after the block). Set by
+ * liveness analysis. */
+ bool kill : 1;
/* Cache hints */
bool cache : 1;
}
agx_foreach_src(I, s) {
- if (I->src[s].type == AGX_INDEX_NORMAL)
+ if (I->src[s].type == AGX_INDEX_NORMAL) {
+ /* If the source is not live after this instruction, but becomes live
+ * at this instruction, this is the use that kills the source */
+ I->src[s].kill = !BITSET_TEST(live, I->src[s].value);
BITSET_SET(live, I->src[s].value);
+ }
}
}
if (index.discard)
fprintf(fp, "`");
+ if (index.kill)
+ fprintf(fp, "*");
+
fprintf(fp, "%u", index.value);
break;