i965/link: Make better use of temporary variables
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 28 Sep 2017 16:55:15 +0000 (09:55 -0700)
committerJordan Justen <jordan.l.justen@intel.com>
Thu, 28 Sep 2017 23:19:54 +0000 (16:19 -0700)
commit69ed3244d4d9898e5353d34be6a160db409b6dc8
treec1cac0d07d6e56f00f8cc5cddb43ef31a1ac27ce
parentce09364d4ec527ceee5be8bf4a08fb27cd2bf152
i965/link: Make better use of temporary variables

The way NIR_PASS works (and, by extension, nir_optimize) is that they
may clone the shader and throw the old one away.  (We use this for
testing nir_clone.)  It's better if we just make a temporary variable,
use it for everything, and re-assign to the gl_program at the end.

[jordan.l.justen@intel.com: Tested NIR_TEST_CLONE=1 with valgrind]
Tested-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
src/mesa/drivers/dri/i965/brw_link.cpp