[Mesa-dev] [PATCH 0/3] [RFC] mesa/st: glsl_to_tgsi: improved temp-reg lifetime estimation

Gert Wollny gw.fossdev at gmail.com
Wed Jun 14 06:30:19 UTC 2017


Am Dienstag, den 13.06.2017, 11:07 +0200 schrieb Nicolai Hähnle:
> 
> 
> I'm curious what you'd suggest for getting rid of allocations anyway.

As the refactoring goes I think I will end up with a hybrid approach:
In the temporaries  I will not keep the full time line, but the
important read/write information - just like you suggested. However, I
will not resolve the scopes at the end of each loop, but only after the
program is fully scanned. For that I need to keep the information of
all scopes available and links to the key scopes fro each temporary.

Equal to what you pointed out above, I'll need three allocations for
this: 

- the vector for the scopes, 
- the vector for the temporaries 
- a stack to handle the scope changes.

To not limit the number of scopes and the scope nesting level the scope
vector and the stack might do re-allocations though.

I think right now I will not go for tracking whether a temporary is
written in both if/else branches or all switch cases. What I want to
achieve is that the drivers don't get into trouble because too many
temporaries need to be allocated when the TGSI is translated into byte
code (test case R600 with 124 free usable registers), and so far this
seems to work without tackling this detail. 

Thank you again for your insights, 
Gert 



More information about the mesa-dev mailing list