pan/midgard: Add address analysis framework
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 27 Feb 2020 14:38:21 +0000 (09:38 -0500)
committerMarge Bot <eric+marge@anholt.net>
Thu, 27 Feb 2020 21:02:35 +0000 (21:02 +0000)
commitf5401cb8866cc74c5b3d0fde278fb1046779b415
tree57a66cbf5d1c0729f8b1dde018980365029a05c0
parent658541a7450a850c700ad5b8bf1b5425f32773fc
pan/midgard: Add address analysis framework

Midgard has the ability to calculate addresses as part of the load/store
pipeline. We'd like to make use of this to avoid doing this work on the
ALU pipes. To do so, when emitting globals/SSBOs/shareds, we walk the
tree looking for address arithmetic to try to parse out something the
hardware can work with, letting the original instructions be DCE'd
ideally. This analysis is done at the NIR level to properly account for
some messy details of vectorization which we'd rather not poke at the
backend level. (Originally I wrote this as a MIR pass but I'm fairly
sure it was wrong.)

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3978>
src/panfrost/midgard/midgard_address.c [new file with mode: 0644]