Shaves 1.6% (+/- 1.0%) off of ff_fragment_shader glean texCombine time
(n=5).
progress = optimize_redundant_jumps(ir) || progress;
loop_state *ls = analyze_loop_variables(ir);
- progress = set_loop_controls(ir, ls) || progress;
- progress = unroll_loops(ir, ls, max_unroll_iterations) || progress;
+ if (ls->loop_found) {
+ progress = set_loop_controls(ir, ls) || progress;
+ progress = unroll_loops(ir, ls, max_unroll_iterations) || progress;
+ }
delete ls;
return progress;
this->ht = hash_table_ctor(0, hash_table_pointer_hash,
hash_table_pointer_compare);
this->mem_ctx = talloc_init("loop state");
+ this->loop_found = false;
}
loop_state::insert(ir_loop *ir)
{
loop_variable_state *ls = new(this->mem_ctx) loop_variable_state;
+
hash_table_insert(this->ht, ls, ir);
+ this->loop_found = true;
return ls;
}
loop_variable_state *insert(ir_loop *ir);
+ bool loop_found;
+
private:
loop_state();