From 298740d7a184d65d5c6ac0fc9423760f33bcf2ec Mon Sep 17 00:00:00 2001 From: Caio Oliveira Date: Sat, 14 Oct 2023 22:37:02 -0700 Subject: [PATCH] util/ra: Bump the initial size of adjacency lists For Intel, looking at a few fossils, the majority of nodes have more than 32 entries in the list. I'd expect other backends to have similar numbers. Reviewed-by: Matt Turner Part-of: --- src/util/register_allocate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/register_allocate.c b/src/util/register_allocate.c index 2c2c3fd2bcf..0bca6e4b873 100644 --- a/src/util/register_allocate.c +++ b/src/util/register_allocate.c @@ -519,7 +519,7 @@ ra_add_node_adjacency(struct ra_graph *g, unsigned int n1, unsigned int n2) struct ra_list *adj = &g->nodes[n1].adjacency; if (adj->size == adj->cap) { - adj->cap = MAX2(16, adj->cap * 2); + adj->cap = MAX2(64, adj->cap * 2); adj->elems = reralloc(g, adj->elems, unsigned int, adj->cap); } adj->elems[adj->size++] = n2;