lima/pp: Do not use union undefined behaviour
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Tue, 15 Aug 2023 13:59:01 +0000 (09:59 -0400)
committerAlyssa Rosenzweig <alyssa@rosenzweig.io>
Tue, 10 Oct 2023 08:58:04 +0000 (04:58 -0400)
commit4753ce7d723c0c4a2b2406166b15768f4f0eadb2
treed387748bfd79668544a49b4c1ce4be105dfdc744
parente1622dcca1a1ea27a803c8185c5e1fca253e0290
lima/pp: Do not use union undefined behaviour

It is invalid to read parent_instr for an if-use (or parent_if for a
non-if-use). Make sure we read the right one when handling if-uses.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24671>
src/gallium/drivers/lima/ir/lima_nir_duplicate_consts.c
src/gallium/drivers/lima/ir/lima_nir_duplicate_intrinsic.c