spirv: Don't remove dead variables in `create_library` mode
authorCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Thu, 21 Jan 2021 10:35:43 +0000 (02:35 -0800)
committerMarge Bot <eric+marge@anholt.net>
Fri, 29 Jan 2021 23:36:29 +0000 (23:36 +0000)
commita0d73ca65c0b159a25e9bf6bbe0f5a418f1f58cc
tree38d026ff87485270576697a31f6860fd0ad38779
parentfd44bcf9a843c753fe5915cd79842a965257abfd
spirv: Don't remove dead variables in `create_library` mode

The issues fixed by the removal happen when a module has multiple
entry points and conflicting global variables.  Neither conditions are
expected in a library.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8786>
src/compiler/spirv/spirv_to_nir.c