nir: Avoid coalescing vars created by lower_io_to_temporaries
authorConnor Abbott <cwabbott0@gmail.com>
Wed, 15 May 2019 10:49:29 +0000 (12:49 +0200)
committerConnor Abbott <cwabbott0@gmail.com>
Mon, 8 Jul 2019 12:14:53 +0000 (14:14 +0200)
commit3a2ea2af9d18826967ea48645d5b70e6c7cf39e6
treed2605487cc78abe2f1f37d2491c6bc92b7fcb9ee
parentf3e2c65041f274901018bbb5018e75b2f8ee4d8b
nir: Avoid coalescing vars created by lower_io_to_temporaries

Right now nir_copy_prop_vars is effectively undoing
nir_lower_io_to_temporaries for inputs by propagating the original
variable through the copy created in lower_io_to_temporaries. A
theoretical variable coalescing pass would have the same issue with
output variables, although that doesn't exist yet. To fix this, add a
new bit to nir_variable, and disable copy propagation when it's set.

This doesn't seem to affect any drivers now, probably since since no one
uses lower_io_to_temporaries for inputs as well as copy_prop_vars, but
it will fix radv once we flip on lower_io_to_temporaries for fs inputs.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/compiler/nir/nir.h
src/compiler/nir/nir_lower_io_to_temporaries.c
src/compiler/nir/nir_opt_copy_prop_vars.c