agx: Lift agx_block_add_successor from Panfrost
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
This commit is contained in:

committed by
Marge Bot

parent
2e1ba82060
commit
a207c77314
@@ -49,6 +49,31 @@ int agx_debug = 0;
|
|||||||
fprintf(stderr, "%s:%d: "fmt, \
|
fprintf(stderr, "%s:%d: "fmt, \
|
||||||
__FUNCTION__, __LINE__, ##__VA_ARGS__); } while (0)
|
__FUNCTION__, __LINE__, ##__VA_ARGS__); } while (0)
|
||||||
|
|
||||||
|
static void
|
||||||
|
agx_block_add_successor(agx_block *block, agx_block *successor)
|
||||||
|
{
|
||||||
|
assert(block != NULL && successor != NULL);
|
||||||
|
|
||||||
|
/* Cull impossible edges */
|
||||||
|
if (block->unconditional_jumps)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (unsigned i = 0; i < ARRAY_SIZE(block->successors); ++i) {
|
||||||
|
if (block->successors[i]) {
|
||||||
|
if (block->successors[i] == successor)
|
||||||
|
return;
|
||||||
|
else
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
block->successors[i] = successor;
|
||||||
|
_mesa_set_add(successor->predecessors, block);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
unreachable("Too many successors");
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
agx_emit_load_const(agx_builder *b, nir_load_const_instr *instr)
|
agx_emit_load_const(agx_builder *b, nir_load_const_instr *instr)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user