On Tue, 19 Apr 2011 23:09:46 -0700, Tom Stellard <[email protected]> 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 <[email protected]>

Attachment: pgpVDG5naJIix.pgp
Description: PGP signature

_______________________________________________
mesa-dev mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to