[Mesa-dev] [PATCH] ra: Add ra_set_node_reg()

Eric Anholt eric at anholt.net
Sun Apr 24 14:00:40 PDT 2011


On Tue, 19 Apr 2011 23:09:46 -0700, Tom Stellard <tstellar at gmail.com> wrote:
> This function makes it possible to include input / payload registers in
> the interference graph.

[...]

> +/**
> + * This function allows a user to manually assign a register to a node.  This
> + * is useful for nodes that belong to register classes that contain a very small
> + * number of registers that are not likely to be allocated if they end up at
> + * the bottom of the stack.
> + */
> +void
> +ra_set_node_reg(struct ra_graph *g, unsigned int n, unsigned int reg)
> +{
> +   g->nodes[n].reg = reg;
> +   g->nodes[n].in_stack = GL_FALSE;
> +}
> +

So, this problem could also be solved by creating a register class per
payload register and including the nodes for the payload data in those
classes, right?  However, I think you've got a good, safe solution for
some common uses that doesn't cause the size of the allocator data to
explode even more.

The comment I think I would have written for this function is:

/**
 * Forces a node to a specific register.  This can be used to avoid
 * creating a register class containing one node when handling data
 * that must live in a fixed location and is known to not conflict
 * with other forced register assignment (as is common with shader
 * input data).  These nodes do not end up in the stack during
 * ra_simplify(), and thus at ra_select() time it is as if they were
 * the first popped off the stack and assigned their fixed locations.
 *
 * Must be called before ra_simplify().
 */

Overall,

Reviewed-by: Eric Anholt <eric at anholt.net>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20110424/cd12b514/attachment.pgp>


More information about the mesa-dev mailing list