OSDN Git Service

r600g/sb: use simple heuristic to limit register pressure
authorVadim Girlin <vadimgirlin@gmail.com>
Sat, 27 Apr 2013 08:03:39 +0000 (12:03 +0400)
committerVadim Girlin <vadimgirlin@gmail.com>
Tue, 30 Apr 2013 17:50:48 +0000 (21:50 +0400)
commit3e476c311f9e131d255a9946d0cf7acc74a07dad
tree482cfda548ef8171fb7658c66520805af82ffb87
parent6d6c8c88a38ccdd453d2ad184e58b3eb35230a5a
r600g/sb: use simple heuristic to limit register pressure

It's not a complete register pressure tracking, yet it helps to prevent
register allocation problems in some cases where they were observed.

The problems are uncovered by false dependencies between fetch instructions
introduced by some recent changes in TGSI and/or default backend.
Sometimes we have code like this:

...
SAMPLE R5.xyzw, R5.xyzw
... store R5.xyzw somewhere
MOV R5.x, <next x coord>
MOV R5.y, <next y coord>
SAMPLE R5.xyzw, R5.xyzw
... <may be repeated a lot of times>

With 2D resources, z and w in SAMPLE src reg aren't used and can be simply
masked, but shader backend doesn't have this information, so it's
considered as data dependency by optimization algorithms.
src/gallium/drivers/r600/sb/sb_gcm.cpp
src/gallium/drivers/r600/sb/sb_pass.h