#include "nir.h"
#include "nir_worklist.h"
+#include "nir_vla.h"
/*
* Basic liveness analysis. This works only in SSA form.
propagate_across_edge(nir_block *pred, nir_block *succ,
struct live_variables_state *state)
{
- BITSET_WORD live[state->bitset_words];
- memcpy(live, succ->live_in, sizeof live);
+ NIR_VLA(BITSET_WORD, live, state->bitset_words);
+ memcpy(live, succ->live_in, state->bitset_words * sizeof *live);
nir_foreach_instr(succ, instr) {
if (instr->type != nir_instr_type_phi)
break;
nir_phi_instr *phi = nir_instr_as_phi(instr);
- foreach_list_typed(nir_phi_src, src, node, &phi->srcs) {
+ nir_foreach_phi_src(phi, src) {
if (src->pred == pred) {
set_src_live(&src->src, live);
break;