[tuples] memory statistics gathering for tuples

Diego Novillo dnovillo@google.com
Wed Mar 12 15:38:00 GMT 2008


On 3/11/08 12:13 PM, Aldy Hernandez wrote:

> I will be using this to benchmark the memory comsumption of the tuples
> branch.
 >
 > Diego, are you ok with this?

Sure.  A few things to keep in mind when doing this:

1- Do not expect big savings.  Projections are in the single digits %.

2- Make sure you disable in mainline the same code paths disabled in the 
branch.

3- The easiest approach will probably be comparing statement lists 
versus gimple sequences.  We still haven't gone through making sure we 
release all the expression trees that are gimplified.

> @@ -186,9 +212,14 @@ gimple_alloc (enum gimple_code code)
>  static void
>  gimple_alloc_ops (gimple stmt, size_t num_ops)
>  {
> -  stmt->with_ops.op = ggc_alloc_cleared (sizeof (tree) * num_ops);
> +  unsigned int size = sizeof (tree) * num_ops;

Here you're just counting the size of the pointer.  You need to call 
tree_code_size for each operand added.

Looks OK, otherwise.

One way of making sure these numbers are OK is to count manually a few 
statements.  There are three components:

- Size of each statement.  The size of the tuple plus the aggregated 
sizes of its operands.

- Size of sequences.  Size of the gimple_seq_nodes * number of 
statements + size of statements * number of statements.

- Sizes of basic blocks.  Size of basic block plus size of the contained 
sequence.


Diego.



More information about the Gcc-patches mailing list