nv50/ir: only unspill once ahead of a group of instructions
authorIlia Mirkin <imirkin@alum.mit.edu>
Mon, 7 Dec 2015 04:25:54 +0000 (23:25 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Wed, 9 Dec 2015 04:15:29 +0000 (23:15 -0500)
commit99581ca393037e10d17aab1f4c90ff2bdb1ec557
tree6dfd71adaeb4ae8c5e9d24263213a54efb184a24
parent0f647bd65bae16c7a2dc7a960c96593ad6ab729c
nv50/ir: only unspill once ahead of a group of instructions

We already semi-did this but the list of uses as unsorted, so it was
unreliable. Sort the uses by bb and serial, and don't unspill for each
instruction in a sequence. (And also don't unspill multiple times for a
single instruction that uses the value in question multiple times.)

This causes a minor reduction in generated instructions for shader-db
(as few programs spill) but more importantly it brings determinism to
each run's output.

On SM10:

total instructions in shared programs : 6387945 -> 6379359 (-0.13%)
total gprs used in shared programs    : 728544 -> 728544 (0.00%)
total local used in shared programs   : 9904 -> 9904 (0.00%)

                local        gpr       inst      bytes
    helped           0           0         322         322
      hurt           0           0           0           0

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp