nir/opt_deref: Remove restrictive alignment information from casts
authorJason Ekstrand <jason@jlekstrand.net>
Mon, 24 Aug 2020 16:27:31 +0000 (11:27 -0500)
committerMarge Bot <eric+marge@anholt.net>
Thu, 3 Sep 2020 18:02:50 +0000 (18:02 +0000)
commite7fbec0e090be3e796f7a38819fb99bbc1744787
tree3e50bec572a8f60eaefe729bcd00a2c94c5dc565
parent99bb2a4de66fa662fb4bcb29df8e2749972ee986
nir/opt_deref: Remove restrictive alignment information from casts

If we have a cast deref with alignment information and we can get equal
or better alignment information from something further up the deref
chain, we can strip the alignment information from the cast and allow
other optimizations to potentially eliminate the cast.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6472>
src/compiler/nir/nir_deref.c