Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame^] | 1 | From da6e47f1717f34c73de388c56ffaf4861a07fdc5 Mon Sep 17 00:00:00 2001 |
| 2 | From: t bettler <thomas.bettler@gmail.com> |
| 3 | Date: Sat, 9 Jul 2022 09:28:51 +0000 |
| 4 | Subject: [PATCH] nir/nir_opt_move: fix ALWAYS_INLINE compiler error |
| 5 | MIME-Version: 1.0 |
| 6 | Content-Type: text/plain; charset=UTF-8 |
| 7 | Content-Transfer-Encoding: 8bit |
| 8 | |
Patrick Williams | db4c27e | 2022-08-05 08:10:29 -0500 | [diff] [blame] | 9 | Backport merge request to fix mesa compile error when debug build |
| 10 | enabled. |
| 11 | |
| 12 | Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17439] |
| 13 | |
| 14 | Signed-off-by: Kai Kang <kai.kang@windriver.com> |
| 15 | |
Patrick Williams | db4c27e | 2022-08-05 08:10:29 -0500 | [diff] [blame] | 16 | MIME-Version: 1.0 |
| 17 | Content-Type: text/plain; charset=UTF-8 |
| 18 | Content-Transfer-Encoding: 8bit |
| 19 | |
| 20 | fix call to ‘always_inline’ ‘src_is_ssa’ |
| 21 | |
| 22 | Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6825 |
| 23 | Fixes: f1d20ec67c3f186886b97de94f74484650f8fda1 ("nir/nir_opt_move: handle non-SSA defs ") |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame^] | 24 | |
Patrick Williams | db4c27e | 2022-08-05 08:10:29 -0500 | [diff] [blame] | 25 | --- |
| 26 | src/compiler/nir/nir_inline_helpers.h | 10 ++++++++-- |
| 27 | src/compiler/nir/nir_opt_move.c | 2 +- |
| 28 | 2 files changed, 9 insertions(+), 3 deletions(-) |
| 29 | |
| 30 | diff --git a/src/compiler/nir/nir_inline_helpers.h b/src/compiler/nir/nir_inline_helpers.h |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame^] | 31 | index 125dd8a..ec33f05 100644 |
Patrick Williams | db4c27e | 2022-08-05 08:10:29 -0500 | [diff] [blame] | 32 | --- a/src/compiler/nir/nir_inline_helpers.h |
| 33 | +++ b/src/compiler/nir/nir_inline_helpers.h |
| 34 | @@ -73,8 +73,8 @@ nir_foreach_dest(nir_instr *instr, nir_foreach_dest_cb cb, void *state) |
| 35 | return _nir_foreach_dest(instr, cb, state); |
| 36 | } |
| 37 | |
| 38 | -static inline bool |
| 39 | -nir_foreach_src(nir_instr *instr, nir_foreach_src_cb cb, void *state) |
| 40 | +static ALWAYS_INLINE bool |
| 41 | +_nir_foreach_src(nir_instr *instr, nir_foreach_src_cb cb, void *state) |
| 42 | { |
| 43 | switch (instr->type) { |
| 44 | case nir_instr_type_alu: { |
| 45 | @@ -162,3 +162,9 @@ nir_foreach_src(nir_instr *instr, nir_foreach_src_cb cb, void *state) |
| 46 | dest_state.cb = cb; |
| 47 | return _nir_foreach_dest(instr, _nir_visit_dest_indirect, &dest_state); |
| 48 | } |
| 49 | + |
| 50 | +static inline bool |
| 51 | +nir_foreach_src(nir_instr *instr, nir_foreach_src_cb cb, void *state) |
| 52 | +{ |
| 53 | + return _nir_foreach_src(instr, cb, state); |
| 54 | +} |
| 55 | diff --git a/src/compiler/nir/nir_opt_move.c b/src/compiler/nir/nir_opt_move.c |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame^] | 56 | index 81bcde5..051c3cc 100644 |
Patrick Williams | db4c27e | 2022-08-05 08:10:29 -0500 | [diff] [blame] | 57 | --- a/src/compiler/nir/nir_opt_move.c |
| 58 | +++ b/src/compiler/nir/nir_opt_move.c |
| 59 | @@ -60,7 +60,7 @@ src_is_ssa(nir_src *src, void *state) |
| 60 | static ALWAYS_INLINE bool |
| 61 | instr_reads_register(nir_instr *instr) |
| 62 | { |
| 63 | - return !nir_foreach_src(instr, src_is_ssa, NULL); |
| 64 | + return !_nir_foreach_src(instr, src_is_ssa, NULL); |
| 65 | } |
| 66 | |
| 67 | static bool |