util/ra: Don't destroy the graph in ra_allocate()
authorJason Ekstrand <jason@jlekstrand.net>
Wed, 8 May 2019 21:41:41 +0000 (16:41 -0500)
committerJason Ekstrand <jason@jlekstrand.net>
Tue, 14 May 2019 17:30:22 +0000 (12:30 -0500)
commite291cd8a7e412f593a2c986f532906ffa39ba017
tree1c9a54b23f126c2819cf77f96fdb2ec8f04146d9
parent9040215f5d2894e9a900b0f4b154c617f9a0db27
util/ra: Don't destroy the graph in ra_allocate()

We want to be able to call ra_allocate() and, when it fails, mutate the
graph and try again rather than re-building the graph from scratch.
This commit moves all the scratch bits except the final register
allocation (which is really an out value not scratch) into sub-structs
named "tmp" to make it clear which things are scratch.  It also adds
bits to the ra_select() initialization loop to initialize things (since
we can't trust rzalloc anymore) and copy q_test and forced_reg over.

Reviewed-by: Eric Anholt <eric@anholt.net>
src/util/register_allocate.c