diff options
author | Erico Nunes <[email protected]> | 2020-01-22 00:42:14 +0100 |
---|---|---|
committer | Erico Nunes <[email protected]> | 2020-01-25 14:48:55 +0100 |
commit | ab36523ae7c4abe3fa55c43e9c5e63b157aa7981 (patch) | |
tree | 8a9c74cd1b5bd2ab0bd7127ee7321df21e0d1d72 /src/gallium/drivers/lima/ir | |
parent | 4ca3de06ec35e5f72827b0cc61a4119e53500681 (diff) |
lima/ppir: split ppir_op_undef into undef and dummy again
Those were renamed/merged some time ago but it turns out that
ppir_op_undef can't be shared.
It was being used for undefined ssa operations and for read-before-write
operations that may happen to e.g. uninitialized registers (non-ssa)
inside a loop.
We really don't want to reserve a register for the undef ssa case, but
we must reserve and allocate register for the unitialized register case
because when it happens inside a loop it may need to hold its value
across iterations.
This dummy node might be eliminated with a code refactor in ppir in case
we are able to emit the write and allocate the ppir_reg before we emit
the read. But a major refactor we need this to keep this code to avoid
apparent regressions with the new liveness analysis implementation.
Signed-off-by: Erico Nunes <[email protected]>
Reviewed-by: Vasily Khoruzhick <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3502>
Diffstat (limited to 'src/gallium/drivers/lima/ir')
-rw-r--r-- | src/gallium/drivers/lima/ir/pp/nir.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/lima/ir/pp/node.c | 6 | ||||
-rw-r--r-- | src/gallium/drivers/lima/ir/pp/ppir.h | 1 |
3 files changed, 9 insertions, 2 deletions
diff --git a/src/gallium/drivers/lima/ir/pp/nir.c b/src/gallium/drivers/lima/ir/pp/nir.c index 9798d16dd1e..61664a02941 100644 --- a/src/gallium/drivers/lima/ir/pp/nir.c +++ b/src/gallium/drivers/lima/ir/pp/nir.c @@ -156,12 +156,12 @@ static void ppir_node_add_src(ppir_compiler *comp, ppir_node *node, child = comp->var_nodes[(reg->index << 2) + comp->reg_base + swizzle]; /* Reg is read before it was written, create a dummy node for it */ if (!child) { - child = ppir_node_create_reg(node->block, ppir_op_undef, reg, + child = ppir_node_create_reg(node->block, ppir_op_dummy, reg, u_bit_consecutive(0, 4)); comp->var_nodes[(reg->index << 2) + comp->reg_base + swizzle] = child; } /* Don't add dummies or recursive deps for ops like r1 = r1 + ssa1 */ - if (child && node != child && child->op != ppir_op_undef) + if (child && node != child && child->op != ppir_op_dummy) ppir_node_add_dep(node, child, ppir_dep_src); } } diff --git a/src/gallium/drivers/lima/ir/pp/node.c b/src/gallium/drivers/lima/ir/pp/node.c index 5090d1b9921..e646a395ca7 100644 --- a/src/gallium/drivers/lima/ir/pp/node.c +++ b/src/gallium/drivers/lima/ir/pp/node.c @@ -348,6 +348,12 @@ const ppir_op_info ppir_op_infos[] = { .slots = (int []) { }, }, + [ppir_op_dummy] = { + .name = "dummy", + .type = ppir_node_type_alu, + .slots = (int []) { + }, + }, }; void *ppir_node_create(ppir_block *block, ppir_op op, int index, unsigned mask) diff --git a/src/gallium/drivers/lima/ir/pp/ppir.h b/src/gallium/drivers/lima/ir/pp/ppir.h index f58dd8be730..b2637cb68c3 100644 --- a/src/gallium/drivers/lima/ir/pp/ppir.h +++ b/src/gallium/drivers/lima/ir/pp/ppir.h @@ -116,6 +116,7 @@ typedef enum { ppir_op_branch, ppir_op_undef, + ppir_op_dummy, ppir_op_num, } ppir_op; |