diff options
author | Friedrich Vock <friedrich.vock@gmx.de> | 2023-04-17 15:58:39 +0200 |
---|---|---|
committer | Eric Engestrom <eric@igalia.com> | 2023-06-07 11:14:20 +0200 |
commit | 56198c4851d82af15a8e69f8083c2b7cad672de9 (patch) | |
tree | 928396081ce544adac957a52938e3bccf3e49811 /src | |
parent | ea9cdbbba93aa7b4cd3b8f85cde7ef246346479f (diff) | |
download | mesa-56198c4851d82af15a8e69f8083c2b7cad672de9.tar.gz mesa-56198c4851d82af15a8e69f8083c2b7cad672de9.tar.bz2 mesa-56198c4851d82af15a8e69f8083c2b7cad672de9.zip |
nir: Rematerialize derefs in use blocks before repairing SSA
nir_repair_ssa_impl may insert phi nodes for any deref, but if the deref mode is uniform, validation fails.
To fix this, rematerialize the derefs in the blocks they are used to avoid generating phi nodes for them.
Cc: mesa-stable
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22536>
(cherry picked from commit ee2764d5e86005b24c2ede5432bdde8ce66880dd)
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/nir/nir_lower_returns.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_lower_returns.c b/src/compiler/nir/nir_lower_returns.c index d7126cbe042..eae9071bd54 100644 --- a/src/compiler/nir/nir_lower_returns.c +++ b/src/compiler/nir/nir_lower_returns.c @@ -287,6 +287,7 @@ nir_lower_returns_impl(nir_function_impl *impl) if (progress) { nir_metadata_preserve(impl, nir_metadata_none); + nir_rematerialize_derefs_in_use_blocks_impl(impl); nir_repair_ssa_impl(impl); } else { nir_metadata_preserve(impl, nir_metadata_all); |