ir3: Add ir3_register::array.base
authorConnor Abbott <cwabbott0@gmail.com>
Fri, 19 Feb 2021 10:18:02 +0000 (11:18 +0100)
committerEmma Anholt <emma@anholt.net>
Thu, 10 Jun 2021 19:20:38 +0000 (12:20 -0700)
commit9ad83f51eb3c089aad0640c2ee6ad6d9477fc2b6
tree3553d046cc6cc9c4c6519efa63345e17543180f5
parent939ee6966f87aa783f43b06ce3e9686ca2caa775
ir3: Add ir3_register::array.base

There were two different approaches I saw in the post-RA code for
figuring out what regiser range a relative access touched:

1. Use reg->array.offset and reg->array.size. This is wrong in case
   reg->array.offset was non-zero before RA, because array.size is
   the size of the whole array and array.offset has the const offset
   within the array baked in.
2. Lookup the array from the array ID and use the base + range there.
   This is correct, but won't work with the new RA, where an array might
   not always be assigned to the same register.

This replaces both methods with a new ir3_register::array.base field,
and switches all the users I could find to it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9842>
src/freedreno/ir3/ir3.c
src/freedreno/ir3/ir3.h
src/freedreno/ir3/ir3_postsched.c
src/freedreno/ir3/ir3_ra.c