Commit 0f37dad0 authored by Timothy Arceri's avatar Timothy Arceri

nir/loop_analyze: handle swizzles on invariant

Fixes: 6772a17a ("nir: Add a loop analysis pass")
Tested-by: Brian Paul's avatarBrian Paul <brianp@vmware.com>
parent 0974914e
......@@ -959,9 +959,10 @@ find_trip_count(loop_info_state *state)
nir_instr_as_load_const(basic_ind->ind->def_outside_loop->
def->parent_instr)->value;
unsigned invariant_swz = basic_ind->ind->invariant->swizzle[0];
nir_const_value *step_val =
nir_instr_as_load_const(basic_ind->ind->invariant->src.ssa->
parent_instr)->value;
&(nir_instr_as_load_const(basic_ind->ind->invariant->src.ssa->
parent_instr)->value[invariant_swz]);
int iterations = calculate_iterations(initial_val, step_val,
&limit_val,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment