glsl: Consider the "else" branch when looking for loop breaks.

Found this bug by code inspection.  Based off the comments just before
this code, the intent is to find whether the break exists in the "then"
branch or the "else" branch.  However, the code actually looked at the
last instruction in the "then" branch twice.
(cherry picked from commit 13c45c590b)
This commit is contained in:
Kenneth Graunke 2010-12-01 15:33:56 -08:00 committed by Ian Romanick
parent 760288bec1
commit 4f2f3440d0

View file

@ -104,7 +104,7 @@ loop_unroll_visitor::visit_leave(ir_loop *ir)
if (is_break(last)) {
continue_from_then_branch = false;
} else {
last = (ir_instruction *) last_if->then_instructions.get_tail();
last = (ir_instruction *) last_if->else_instructions.get_tail();
if (is_break(last))
continue_from_then_branch = true;