diff options
author | Jason Ekstrand <[email protected]> | 2019-07-22 00:51:24 -0500 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2019-07-22 16:17:18 -0500 |
commit | 5c5f11d1dd3b52e80483f132236c690cbbc3ea0b (patch) | |
tree | 4c553ebc8481c73372b0fae746877687ccf30e8d /src/compiler/nir/nir_liveness.c | |
parent | fa63fad3332309afa14fea68c87cf6aa138fb45c (diff) |
nir: Remove a bunch of large stack arrays
Reviewed-by: Lionel Landwerlin <[email protected]>
Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_liveness.c')
-rw-r--r-- | src/compiler/nir/nir_liveness.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/compiler/nir/nir_liveness.c b/src/compiler/nir/nir_liveness.c index 03e252fbfd8..16dbeb4a223 100644 --- a/src/compiler/nir/nir_liveness.c +++ b/src/compiler/nir/nir_liveness.c @@ -46,6 +46,9 @@ struct live_ssa_defs_state { unsigned num_ssa_defs; unsigned bitset_words; + /* Used in propagate_across_edge() */ + BITSET_WORD *tmp_live; + nir_block_worklist worklist; }; @@ -121,7 +124,7 @@ static bool propagate_across_edge(nir_block *pred, nir_block *succ, struct live_ssa_defs_state *state) { - NIR_VLA(BITSET_WORD, live, state->bitset_words); + BITSET_WORD *live = state->tmp_live; memcpy(live, succ->live_in, state->bitset_words * sizeof *live); nir_foreach_instr(instr, succ) { @@ -176,6 +179,7 @@ nir_live_ssa_defs_impl(nir_function_impl *impl) * blocks to the worklist. */ state.bitset_words = BITSET_WORDS(state.num_ssa_defs); + state.tmp_live = rzalloc_array(impl, BITSET_WORD, state.bitset_words); nir_foreach_block(block, impl) { init_liveness_block(block, &state); } @@ -225,6 +229,7 @@ nir_live_ssa_defs_impl(nir_function_impl *impl) } } + ralloc_free(state.tmp_live); nir_block_worklist_fini(&state.worklist); } |