pan/bi: Move FAUs to memory for memory phis

We can have PHIs like this: m10 = PHI u2, 3.
For these, insert_coupling_code will spill the sources but that doesn't
work properly for FAU values before this commit because bi_index_as_mem
asserts that index.type == BI_INDEX_NORMAL and we also can't look up an
FAU index in ctx->S_exit or ctx->remat.

Fixes: 6c64ad93 ("panfrost: spill registers in SSA form")
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
(cherry picked from commit 8a4d8d490b)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40359>
This commit is contained in:
Christoph Pillmayer 2026-03-03 10:59:18 +01:00 committed by Eric Engestrom
parent 955a82bb83
commit d6ea90b495
2 changed files with 4 additions and 3 deletions

View file

@ -3554,7 +3554,7 @@
"description": "pan/bi: Move FAUs to memory for memory phis",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "6c64ad934f76dc142926c7a1261ac94d80dca0a9",
"notes": null

View file

@ -553,9 +553,10 @@ insert_coupling_code(struct spill_ctx *ctx, bi_block *pred, bi_block *succ)
/* Copy immediate/uniform phi sources to memory variables at the start of
* the program, where pressure is zero and hence the copy is legal.
*/
if (I->src[s].type != BI_INDEX_NORMAL && I->src[s].type != BI_INDEX_FAU) {
if (I->src[s].type != BI_INDEX_NORMAL) {
assert(I->src[s].type == BI_INDEX_CONSTANT ||
I->src[s].type == BI_INDEX_REGISTER);
I->src[s].type == BI_INDEX_REGISTER ||
I->src[s].type == BI_INDEX_FAU);
bi_index gpr = bi_temp(ctx->shader);
unsigned bits = 32;