glsl: don't drop instructions from unreachable terminators continue branch

These instructions will be executed on every iteration of the loop
we cannot drop them.

V2:
- move removal of unreachable terminators from the terminator list
  to the same place they are removed from the IR as suggested by
  Nicolai.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
This commit is contained in:
Timothy Arceri
2017-09-05 15:59:07 +10:00
parent c63ce5c95d
commit ab23b759f2
2 changed files with 27 additions and 8 deletions

View File

@@ -34,6 +34,13 @@
extern class loop_state *
analyze_loop_variables(exec_list *instructions);
static inline bool
is_break(ir_instruction *ir)
{
return ir != NULL && ir->ir_type == ir_type_loop_jump &&
((ir_loop_jump *) ir)->is_break();
}
extern bool
unroll_loops(exec_list *instructions, loop_state *ls,