diff options
author | Paul Berry <[email protected]> | 2013-11-29 00:52:11 -0800 |
---|---|---|
committer | Paul Berry <[email protected]> | 2013-12-09 10:55:09 -0800 |
commit | 088494aa032bf32db8b67f1fb07e5797603a473d (patch) | |
tree | 75118fb62d60fa288e77d0e14552e929e51de4b0 | |
parent | 7ea3baa64da061f86a50c41081a26e0c2859e99c (diff) |
glsl/loops: Get rid of lower_bounded_loops and ir_loop::normative_bound.
Now that loop_controls no longer creates normatively bound loops,
there is no need for ir_loop::normative_bound or the
lower_bounded_loops pass.
Reviewed-by: Ian Romanick <[email protected]>
45 files changed, 35 insertions, 221 deletions
diff --git a/src/glsl/Makefile.sources b/src/glsl/Makefile.sources index 724c7b403ca..2e81deddabb 100644 --- a/src/glsl/Makefile.sources +++ b/src/glsl/Makefile.sources @@ -59,7 +59,6 @@ LIBGLSL_FILES = \ $(GLSL_SRCDIR)/loop_analysis.cpp \ $(GLSL_SRCDIR)/loop_controls.cpp \ $(GLSL_SRCDIR)/loop_unroll.cpp \ - $(GLSL_SRCDIR)/lower_bounded_loops.cpp \ $(GLSL_SRCDIR)/lower_clip_distance.cpp \ $(GLSL_SRCDIR)/lower_discard.cpp \ $(GLSL_SRCDIR)/lower_discard_flow.cpp \ diff --git a/src/glsl/ir.cpp b/src/glsl/ir.cpp index 29fe64ad496..623bc1bb2e9 100644 --- a/src/glsl/ir.cpp +++ b/src/glsl/ir.cpp @@ -1277,7 +1277,6 @@ ir_constant::is_basis() const ir_loop::ir_loop() { this->ir_type = ir_type_loop; - this->normative_bound = -1; } diff --git a/src/glsl/ir.h b/src/glsl/ir.h index a34a9c3193b..7a939a236b8 100644 --- a/src/glsl/ir.h +++ b/src/glsl/ir.h @@ -1024,13 +1024,6 @@ public: /** List of ir_instruction that make up the body of the loop. */ exec_list body_instructions; - - /** - * Normative bound for the loop. If this value is >= 0, the back-end - * should generate instructions to ensure that the loop executes no more - * than this many times. - */ - int normative_bound; }; diff --git a/src/glsl/ir_clone.cpp b/src/glsl/ir_clone.cpp index 383627ae3e2..df6e971f41a 100644 --- a/src/glsl/ir_clone.cpp +++ b/src/glsl/ir_clone.cpp @@ -158,8 +158,6 @@ ir_loop::clone(void *mem_ctx, struct hash_table *ht) const { ir_loop *new_loop = new(mem_ctx) ir_loop(); - new_loop->normative_bound = this->normative_bound; - foreach_iter(exec_list_iterator, iter, this->body_instructions) { ir_instruction *ir = (ir_instruction *)iter.get(); new_loop->body_instructions.push_tail(ir->clone(mem_ctx, ht)); diff --git a/src/glsl/ir_optimization.h b/src/glsl/ir_optimization.h index 87c2c820b3c..3ca9f574453 100644 --- a/src/glsl/ir_optimization.h +++ b/src/glsl/ir_optimization.h @@ -101,7 +101,6 @@ bool do_swizzle_swizzle(exec_list *instructions); bool do_tree_grafting(exec_list *instructions); bool do_vec_index_to_cond_assign(exec_list *instructions); bool do_vec_index_to_swizzle(exec_list *instructions); -bool lower_bounded_loops(exec_list *instructions); bool lower_discard(exec_list *instructions); void lower_discard_flow(exec_list *instructions); bool lower_instructions(exec_list *instructions, unsigned what_to_lower); diff --git a/src/glsl/ir_print_visitor.cpp b/src/glsl/ir_print_visitor.cpp index 857a27ad21f..2beefedf16e 100644 --- a/src/glsl/ir_print_visitor.cpp +++ b/src/glsl/ir_print_visitor.cpp @@ -523,10 +523,7 @@ ir_print_visitor::visit(ir_if *ir) void ir_print_visitor::visit(ir_loop *ir) { - printf("(loop ("); - if (ir->normative_bound >= 0) - printf("%d", ir->normative_bound); - printf(") (\n"); + printf("(loop (\n"); indentation++; foreach_iter(exec_list_iterator, iter, ir->body_instructions) { diff --git a/src/glsl/ir_reader.cpp b/src/glsl/ir_reader.cpp index 72ce684b69c..4afe2810139 100644 --- a/src/glsl/ir_reader.cpp +++ b/src/glsl/ir_reader.cpp @@ -488,34 +488,16 @@ ir_reader::read_if(s_expression *expr, ir_loop *loop_ctx) ir_loop * ir_reader::read_loop(s_expression *expr) { - s_expression *s_bound_expr, *s_body, *s_bound; + s_expression *s_body; - s_pattern loop_pat[] = { "loop", s_bound_expr, s_body }; - s_pattern no_bound_pat[] = { }; - s_pattern bound_pat[] = { s_bound }; + s_pattern loop_pat[] = { "loop", s_body }; if (!MATCH(expr, loop_pat)) { - ir_read_error(expr, "expected (loop <bound> <body>)"); + ir_read_error(expr, "expected (loop <body>)"); return NULL; } ir_loop *loop = new(mem_ctx) ir_loop; - if (MATCH(s_bound_expr, no_bound_pat)) { - loop->normative_bound = -1; - } else if (MATCH(s_bound_expr, bound_pat)) { - s_int *value = SX_AS_INT(s_bound); - if (value == NULL) { - ir_read_error(s_bound_expr, "malformed loop bound"); - delete loop; - return NULL; - } - loop->normative_bound = value->value(); - } else { - ir_read_error(s_bound_expr, "malformed loop bound"); - delete loop; - return NULL; - } - read_instructions(&loop->body_instructions, s_body, loop); if (state->error) { delete loop; diff --git a/src/glsl/loop_controls.cpp b/src/glsl/loop_controls.cpp index 385c2031c42..3db06ad18c1 100644 --- a/src/glsl/loop_controls.cpp +++ b/src/glsl/loop_controls.cpp @@ -193,13 +193,6 @@ loop_control_visitor::visit_leave(ir_loop *ir) this->progress = true; return visit_continue; } - - /* If the limiting terminator has a lower iteration count than the - * normative loop bound (if any), then the loop doesn't need a normative - * bound anymore. - */ - if (ir->normative_bound >= 0 && iterations < ir->normative_bound) - ir->normative_bound = -1; } /* Remove the conditional break statements associated with all terminators @@ -215,7 +208,7 @@ loop_control_visitor::visit_leave(ir_loop *ir) if (t->iterations < 0) continue; - if (ir->normative_bound >= 0 || t != ls->limiting_terminator) { + if (t != ls->limiting_terminator) { t->ir->remove(); assert(ls->num_loop_jumps > 0); diff --git a/src/glsl/loop_unroll.cpp b/src/glsl/loop_unroll.cpp index 4645dcbab19..6eced17365b 100644 --- a/src/glsl/loop_unroll.cpp +++ b/src/glsl/loop_unroll.cpp @@ -228,9 +228,6 @@ loop_unroll_visitor::visit_leave(ir_loop *ir) loop_variable_state *const ls = this->state->get(ir); int iterations; - /* Note: normatively-bounded loops aren't created anymore. */ - assert(ir->normative_bound < 0); - /* If we've entered a loop that hasn't been analyzed, something really, * really bad has happened. */ diff --git a/src/glsl/lower_bounded_loops.cpp b/src/glsl/lower_bounded_loops.cpp deleted file mode 100644 index 0cd907d91b2..00000000000 --- a/src/glsl/lower_bounded_loops.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright © 2013 Intel Corporation - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -/** \file - * - * This pass converts bounded loops (those whose ir_loop contains non-null - * values for \c from, \c to, \c increment, and \c counter) into unbounded - * loops. - * - * For instance: - * - * (loop (declare () uint i) (constant uint 0) (constant uint 4) - * (constant uint 1) - * ...loop body...) - * - * Is transformed into: - * - * (declare () uint i) - * (assign (x) (var_ref i) (constant uint 0)) - * (loop - * (if (expression bool >= (var_ref i) (constant uint 4)) - * (break) - * ()) - * ...loop body... - * (assign (x) (var_ref i) - * (expression uint + (var_ref i) (constant uint 1)))) - */ - -#include "ir_hierarchical_visitor.h" -#include "ir.h" -#include "ir_builder.h" - -using namespace ir_builder; - -namespace { - -class lower_bounded_loops_visitor : public ir_hierarchical_visitor { -public: - lower_bounded_loops_visitor() - : progress(false) - { - } - - virtual ir_visitor_status visit_leave(ir_loop *ir); - - bool progress; -}; - -} /* anonymous namespace */ - - -ir_visitor_status -lower_bounded_loops_visitor::visit_leave(ir_loop *ir) -{ - if (ir->normative_bound < 0) - return visit_continue; - - exec_list new_instructions; - ir_factory f(&new_instructions, ralloc_parent(ir)); - - /* Before the loop, declare the counter and initialize it to zero. */ - ir_variable *counter = f.make_temp(glsl_type::uint_type, "counter"); - f.emit(assign(counter, f.constant(0u))); - ir->insert_before(&new_instructions); - - /* At the top of the loop, compare the counter to normative_bound, and - * break if the comparison succeeds. - */ - ir_loop_jump *brk = new(f.mem_ctx) ir_loop_jump(ir_loop_jump::jump_break); - ir_if *if_inst = if_tree(gequal(counter, - f.constant((unsigned) ir->normative_bound)), - brk); - ir->body_instructions.push_head(if_inst); - - /* At the bottom of the loop, increment the counter. */ - ir->body_instructions.push_tail(assign(counter, - add(counter, f.constant(1u)))); - - /* Since we've explicitly added instructions to terminate the loop, we no - * longer need it to have a normative bound. - */ - ir->normative_bound = -1; - - this->progress = true; - return visit_continue; -} - - -bool -lower_bounded_loops(exec_list *instructions) -{ - lower_bounded_loops_visitor v; - - visit_list_elements(&v, instructions); - - return v.progress; -} diff --git a/src/glsl/tests/lower_jumps/lower_breaks_1.opt_test b/src/glsl/tests/lower_jumps/lower_breaks_1.opt_test index c38ed9e70c6..b412ba8f29f 100755 --- a/src/glsl/tests/lower_jumps/lower_breaks_1.opt_test +++ b/src/glsl/tests/lower_jumps/lower_breaks_1.opt_test @@ -8,6 +8,6 @@ ((declare (out) float a) (function main (signature void (parameters) - ((loop () + ((loop ((assign (x) (var_ref a) (constant float (1.000000))) break)))))) EOF diff --git a/src/glsl/tests/lower_jumps/lower_breaks_1.opt_test.expected b/src/glsl/tests/lower_jumps/lower_breaks_1.opt_test.expected index b278b1c79c1..56ef3e42465 100644 --- a/src/glsl/tests/lower_jumps/lower_breaks_1.opt_test.expected +++ b/src/glsl/tests/lower_jumps/lower_breaks_1.opt_test.expected @@ -1,5 +1,5 @@ ((declare (out) float a) (function main (signature void (parameters) - ((loop () + ((loop ((assign (x) (var_ref a) (constant float (1.000000))) break)))))) diff --git a/src/glsl/tests/lower_jumps/lower_breaks_2.opt_test b/src/glsl/tests/lower_jumps/lower_breaks_2.opt_test index a4a94e05be5..f5de80339cd 100755 --- a/src/glsl/tests/lower_jumps/lower_breaks_2.opt_test +++ b/src/glsl/tests/lower_jumps/lower_breaks_2.opt_test @@ -8,7 +8,7 @@ ((declare (in) float b) (declare (out) float a) (function main (signature void (parameters) - ((loop () + ((loop ((assign (x) (var_ref a) (constant float (1.000000))) (if (expression bool > (var_ref b) (constant float (0.000000))) (break) ()))))))) diff --git a/src/glsl/tests/lower_jumps/lower_breaks_2.opt_test.expected b/src/glsl/tests/lower_jumps/lower_breaks_2.opt_test.expected index 90156be8304..dc231f9753b 100644 --- a/src/glsl/tests/lower_jumps/lower_breaks_2.opt_test.expected +++ b/src/glsl/tests/lower_jumps/lower_breaks_2.opt_test.expected @@ -1,7 +1,7 @@ ((declare (in) float b) (declare (out) float a) (function main (signature void (parameters) - ((loop () + ((loop ((assign (x) (var_ref a) (constant float (1.000000))) (if (expression bool > (var_ref b) (constant float (0.0))) (break) ()))))))) diff --git a/src/glsl/tests/lower_jumps/lower_breaks_3.opt_test b/src/glsl/tests/lower_jumps/lower_breaks_3.opt_test index 4475eea0b35..60368bc1dc9 100755 --- a/src/glsl/tests/lower_jumps/lower_breaks_3.opt_test +++ b/src/glsl/tests/lower_jumps/lower_breaks_3.opt_test @@ -9,7 +9,7 @@ ((declare (in) float b) (declare (out) float a) (declare (out) float c) (function main (signature void (parameters) - ((loop () + ((loop ((assign (x) (var_ref a) (constant float (1.000000))) (if (expression bool > (var_ref b) (constant float (0.000000))) ((assign (x) (var_ref c) (constant float (1.000000))) break) diff --git a/src/glsl/tests/lower_jumps/lower_breaks_3.opt_test.expected b/src/glsl/tests/lower_jumps/lower_breaks_3.opt_test.expected index e31a71257de..8131b66ff4b 100644 --- a/src/glsl/tests/lower_jumps/lower_breaks_3.opt_test.expected +++ b/src/glsl/tests/lower_jumps/lower_breaks_3.opt_test.expected @@ -1,7 +1,7 @@ ((declare (in) float b) (declare (out) float a) (declare (out) float c) (function main (signature void (parameters) - ((loop () + ((loop ((assign (x) (var_ref a) (constant float (1.000000))) (if (expression bool > (var_ref b) (constant float (0.0))) ((assign (x) (var_ref c) (constant float (1.000000))) break) diff --git a/src/glsl/tests/lower_jumps/lower_breaks_4.opt_test b/src/glsl/tests/lower_jumps/lower_breaks_4.opt_test index cb06cfd6ddd..cde319793ba 100755 --- a/src/glsl/tests/lower_jumps/lower_breaks_4.opt_test +++ b/src/glsl/tests/lower_jumps/lower_breaks_4.opt_test @@ -8,7 +8,7 @@ ((declare (in) float b) (declare (out) float a) (function main (signature void (parameters) - ((loop () + ((loop ((assign (x) (var_ref a) (constant float (1.000000))) (if (expression bool > (var_ref b) (constant float (0.000000))) () (break)))))))) diff --git a/src/glsl/tests/lower_jumps/lower_breaks_4.opt_test.expected b/src/glsl/tests/lower_jumps/lower_breaks_4.opt_test.expected index 3c216ed6a57..94dcb37be04 100644 --- a/src/glsl/tests/lower_jumps/lower_breaks_4.opt_test.expected +++ b/src/glsl/tests/lower_jumps/lower_breaks_4.opt_test.expected @@ -1,7 +1,7 @@ ((declare (in) float b) (declare (out) float a) (function main (signature void (parameters) - ((loop () + ((loop ((assign (x) (var_ref a) (constant float (1.000000))) (if (expression bool > (var_ref b) (constant float (0.0))) () (break)))))))) diff --git a/src/glsl/tests/lower_jumps/lower_breaks_5.opt_test b/src/glsl/tests/lower_jumps/lower_breaks_5.opt_test index 0a7a11250f2..157b5892ffe 100755 --- a/src/glsl/tests/lower_jumps/lower_breaks_5.opt_test +++ b/src/glsl/tests/lower_jumps/lower_breaks_5.opt_test @@ -9,7 +9,7 @@ ((declare (in) float b) (declare (out) float a) (declare (out) float c) (function main (signature void (parameters) - ((loop () + ((loop ((assign (x) (var_ref a) (constant float (1.000000))) (if (expression bool > (var_ref b) (constant float (0.000000))) () ((assign (x) (var_ref c) (constant float (1.000000))) break)))))))) diff --git a/src/glsl/tests/lower_jumps/lower_breaks_5.opt_test.expected b/src/glsl/tests/lower_jumps/lower_breaks_5.opt_test.expected index 45e718ddcd6..5b46ccb6773 100644 --- a/src/glsl/tests/lower_jumps/lower_breaks_5.opt_test.expected +++ b/src/glsl/tests/lower_jumps/lower_breaks_5.opt_test.expected @@ -1,7 +1,7 @@ ((declare (in) float b) (declare (out) float a) (declare (out) float c) (function main (signature void (parameters) - ((loop () + ((loop ((assign (x) (var_ref a) (constant float (1.000000))) (if (expression bool > (var_ref b) (constant float (0.0))) () ((assign (x) (var_ref c) (constant float (1.000000))) break)))))))) diff --git a/src/glsl/tests/lower_jumps/lower_breaks_6.opt_test b/src/glsl/tests/lower_jumps/lower_breaks_6.opt_test index 47860630567..4767df13ed4 100755 --- a/src/glsl/tests/lower_jumps/lower_breaks_6.opt_test +++ b/src/glsl/tests/lower_jumps/lower_breaks_6.opt_test @@ -12,7 +12,7 @@ (declare (in) float cb) (function main (signature void (parameters) - ((loop () + ((loop ((if (expression bool > (var_ref a) (constant float (0.000000))) ((if (expression bool > (var_ref ba) (constant float (0.000000))) ((if (expression bool > (var_ref bb) (constant float (0.000000))) diff --git a/src/glsl/tests/lower_jumps/lower_breaks_6.opt_test.expected b/src/glsl/tests/lower_jumps/lower_breaks_6.opt_test.expected index 338d751e84d..967ce642a4b 100644 --- a/src/glsl/tests/lower_jumps/lower_breaks_6.opt_test.expected +++ b/src/glsl/tests/lower_jumps/lower_breaks_6.opt_test.expected @@ -5,7 +5,7 @@ (signature void (parameters) ((declare (temporary) bool break_flag) (assign (x) (var_ref break_flag) (constant bool (0))) - (loop () + (loop ((declare (temporary) bool execute_flag) (assign (x) (var_ref execute_flag) (constant bool (1))) (if (expression bool > (var_ref a) (constant float (0.0))) diff --git a/src/glsl/tests/lower_jumps/lower_guarded_conditional_break.opt_test b/src/glsl/tests/lower_jumps/lower_guarded_conditional_break.opt_test index 0f84c5d507c..164914a4294 100755 --- a/src/glsl/tests/lower_jumps/lower_guarded_conditional_break.opt_test +++ b/src/glsl/tests/lower_jumps/lower_guarded_conditional_break.opt_test @@ -10,7 +10,7 @@ ((declare (in) float aa) (declare (in) float ab) (declare (in) float b) (function main (signature void (parameters) - ((loop () + ((loop ((if (expression bool > (var_ref aa) (constant float (0.000000))) ((if (expression bool > (var_ref ab) (constant float (0.000000))) (continue) diff --git a/src/glsl/tests/lower_jumps/lower_guarded_conditional_break.opt_test.expected b/src/glsl/tests/lower_jumps/lower_guarded_conditional_break.opt_test.expected index 3ce323aead8..841073ed909 100644 --- a/src/glsl/tests/lower_jumps/lower_guarded_conditional_break.opt_test.expected +++ b/src/glsl/tests/lower_jumps/lower_guarded_conditional_break.opt_test.expected @@ -3,7 +3,7 @@ (signature void (parameters) ((declare (temporary) bool break_flag) (assign (x) (var_ref break_flag) (constant bool (0))) - (loop () + (loop ((declare (temporary) bool execute_flag) (assign (x) (var_ref execute_flag) (constant bool (1))) (if (expression bool > (var_ref aa) (constant float (0.0))) diff --git a/src/glsl/tests/lower_jumps/lower_pulled_out_jump.opt_test b/src/glsl/tests/lower_jumps/lower_pulled_out_jump.opt_test index cebdad78d36..1a5c09690bf 100755 --- a/src/glsl/tests/lower_jumps/lower_pulled_out_jump.opt_test +++ b/src/glsl/tests/lower_jumps/lower_pulled_out_jump.opt_test @@ -19,7 +19,7 @@ ((return)) ())) ()) - (loop () + (loop ((if (expression bool > (var_ref b) (constant float (0.000000))) ((if (expression bool > (var_ref c) (constant float (0.000000))) (break) (continue))) diff --git a/src/glsl/tests/lower_jumps/lower_pulled_out_jump.opt_test.expected b/src/glsl/tests/lower_jumps/lower_pulled_out_jump.opt_test.expected index e4339b14268..cf2ef3f080a 100644 --- a/src/glsl/tests/lower_jumps/lower_pulled_out_jump.opt_test.expected +++ b/src/glsl/tests/lower_jumps/lower_pulled_out_jump.opt_test.expected @@ -14,7 +14,7 @@ ())) ()) (if (var_ref execute_flag) - ((loop () + ((loop ((if (expression bool > (var_ref b) (constant float (0.0))) ((if (expression bool > (var_ref c) (constant float (0.0))) () (continue))) diff --git a/src/glsl/tests/lower_jumps/remove_continue_at_end_of_loop.opt_test b/src/glsl/tests/lower_jumps/remove_continue_at_end_of_loop.opt_test index da1caad064e..8403bb2041b 100755 --- a/src/glsl/tests/lower_jumps/remove_continue_at_end_of_loop.opt_test +++ b/src/glsl/tests/lower_jumps/remove_continue_at_end_of_loop.opt_test @@ -8,6 +8,6 @@ ((declare (out) float a) (function main (signature void (parameters) - ((loop () + ((loop ((assign (x) (var_ref a) (constant float (1.000000))) continue)))))) EOF diff --git a/src/glsl/tests/lower_jumps/remove_continue_at_end_of_loop.opt_test.expected b/src/glsl/tests/lower_jumps/remove_continue_at_end_of_loop.opt_test.expected index df2b5483d86..98b74d71e76 100644 --- a/src/glsl/tests/lower_jumps/remove_continue_at_end_of_loop.opt_test.expected +++ b/src/glsl/tests/lower_jumps/remove_continue_at_end_of_loop.opt_test.expected @@ -1,5 +1,5 @@ ((declare (out) float a) (function main (signature void (parameters) - ((loop () + ((loop ((assign (x) (var_ref a) (constant float (1.000000))))))))) diff --git a/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_nothing.opt_test b/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_nothing.opt_test index 0b46a795130..1f62e73498d 100755 --- a/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_nothing.opt_test +++ b/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_nothing.opt_test @@ -8,7 +8,7 @@ ((declare (out) float a) (declare (out) float b) (function sub (signature float (parameters) - ((loop () + ((loop ((assign (x) (var_ref a) (constant float (1.000000))) (return (constant float (2.000000))))) (assign (x) (var_ref b) (constant float (3.000000))) diff --git a/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_nothing.opt_test.expected b/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_nothing.opt_test.expected index a1f3cdee713..040d383b604 100644 --- a/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_nothing.opt_test.expected +++ b/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_nothing.opt_test.expected @@ -1,7 +1,7 @@ ((declare (out) float a) (declare (out) float b) (function sub (signature float (parameters) - ((loop () + ((loop ((assign (x) (var_ref a) (constant float (1.000000))) (return (constant float (2.000000))))) (assign (x) (var_ref b) (constant float (3.000000))) diff --git a/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_return.opt_test b/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_return.opt_test index 0d73a6603b5..42c4e7529b3 100755 --- a/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_return.opt_test +++ b/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_return.opt_test @@ -8,7 +8,7 @@ ((declare (out) float a) (declare (out) float b) (function sub (signature float (parameters) - ((loop () + ((loop ((assign (x) (var_ref a) (constant float (1.000000))) (return (constant float (2.000000))))) (assign (x) (var_ref b) (constant float (3.000000))) diff --git a/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_return.opt_test.expected b/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_return.opt_test.expected index 52bc99ccb3a..792cbf69a99 100644 --- a/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_return.opt_test.expected +++ b/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_return.opt_test.expected @@ -6,7 +6,7 @@ (declare (temporary) float return_value) (declare (temporary) bool return_flag) (assign (x) (var_ref return_flag) (constant bool (0))) - (loop () + (loop ((assign (x) (var_ref a) (constant float (1.000000))) (assign (x) (var_ref return_value) (constant float (2.000000))) (assign (x) (var_ref return_flag) (constant bool (1))) diff --git a/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_return_and_break.opt_test b/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_return_and_break.opt_test index 8b08c996b97..b3eef39b7e2 100755 --- a/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_return_and_break.opt_test +++ b/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_return_and_break.opt_test @@ -8,7 +8,7 @@ ((declare (out) float a) (declare (out) float b) (function sub (signature float (parameters) - ((loop () + ((loop ((assign (x) (var_ref a) (constant float (1.000000))) (return (constant float (2.000000))))) (assign (x) (var_ref b) (constant float (3.000000))) diff --git a/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_return_and_break.opt_test.expected b/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_return_and_break.opt_test.expected index 52bc99ccb3a..792cbf69a99 100644 --- a/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_return_and_break.opt_test.expected +++ b/src/glsl/tests/lower_jumps/return_non_void_at_end_of_loop_lower_return_and_break.opt_test.expected @@ -6,7 +6,7 @@ (declare (temporary) float return_value) (declare (temporary) bool return_flag) (assign (x) (var_ref return_flag) (constant bool (0))) - (loop () + (loop ((assign (x) (var_ref a) (constant float (1.000000))) (assign (x) (var_ref return_value) (constant float (2.000000))) (assign (x) (var_ref return_flag) (constant bool (1))) diff --git a/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_nothing.opt_test b/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_nothing.opt_test index f5b45bc058f..0408282d0d5 100755 --- a/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_nothing.opt_test +++ b/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_nothing.opt_test @@ -8,7 +8,7 @@ ((declare (out) float a) (declare (out) float b) (function main (signature void (parameters) - ((loop () + ((loop ((assign (x) (var_ref a) (constant float (1.000000))) (return))) (assign (x) (var_ref b) (constant float (2.000000))))))) EOF diff --git a/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_nothing.opt_test.expected b/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_nothing.opt_test.expected index ae9359ff273..569213e99f8 100644 --- a/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_nothing.opt_test.expected +++ b/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_nothing.opt_test.expected @@ -1,6 +1,6 @@ ((declare (out) float a) (declare (out) float b) (function main (signature void (parameters) - ((loop () + ((loop ((assign (x) (var_ref a) (constant float (1.000000))) (return))) (assign (x) (var_ref b) (constant float (2.000000))))))) diff --git a/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_return.opt_test b/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_return.opt_test index 2a02101d8ff..a7e65c86ced 100755 --- a/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_return.opt_test +++ b/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_return.opt_test @@ -8,7 +8,7 @@ ((declare (out) float a) (declare (out) float b) (function main (signature void (parameters) - ((loop () + ((loop ((assign (x) (var_ref a) (constant float (1.000000))) (return))) (assign (x) (var_ref b) (constant float (2.000000))))))) EOF diff --git a/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_return.opt_test.expected b/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_return.opt_test.expected index d6dd1db68b5..66f3aeca594 100644 --- a/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_return.opt_test.expected +++ b/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_return.opt_test.expected @@ -3,7 +3,7 @@ (signature void (parameters) ((declare (temporary) bool return_flag) (assign (x) (var_ref return_flag) (constant bool (0))) - (loop () + (loop ((assign (x) (var_ref a) (constant float (1.000000))) (assign (x) (var_ref return_flag) (constant bool (1))) break)) diff --git a/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_return_and_break.opt_test b/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_return_and_break.opt_test index 4c6f9591222..7a5efe5811e 100755 --- a/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_return_and_break.opt_test +++ b/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_return_and_break.opt_test @@ -8,7 +8,7 @@ ((declare (out) float a) (declare (out) float b) (function main (signature void (parameters) - ((loop () + ((loop ((assign (x) (var_ref a) (constant float (1.000000))) (return))) (assign (x) (var_ref b) (constant float (2.000000))))))) EOF diff --git a/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_return_and_break.opt_test.expected b/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_return_and_break.opt_test.expected index d6dd1db68b5..66f3aeca594 100644 --- a/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_return_and_break.opt_test.expected +++ b/src/glsl/tests/lower_jumps/return_void_at_end_of_loop_lower_return_and_break.opt_test.expected @@ -3,7 +3,7 @@ (signature void (parameters) ((declare (temporary) bool return_flag) (assign (x) (var_ref return_flag) (constant bool (0))) - (loop () + (loop ((assign (x) (var_ref a) (constant float (1.000000))) (assign (x) (var_ref return_flag) (constant bool (1))) break)) diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp index 70eb9979442..64ff8998f7e 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp @@ -2181,11 +2181,6 @@ fs_visitor::visit(ir_if *ir) void fs_visitor::visit(ir_loop *ir) { - /* Any normative loop bounds should have been lowered by - * lower_bounded_loops(). - */ - assert(ir->normative_bound < 0); - if (brw->gen < 6 && dispatch_width == 16) { fail("Can't support (non-uniform) control flow on 16-wide\n"); } diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp b/src/mesa/drivers/dri/i965/brw_shader.cpp index 12035c26793..88aa169fc1f 100644 --- a/src/mesa/drivers/dri/i965/brw_shader.cpp +++ b/src/mesa/drivers/dri/i965/brw_shader.cpp @@ -213,8 +213,6 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg) || progress; } while (progress); - lower_bounded_loops(shader->ir); - /* Make a pass over the IR to add state references for any built-in * uniforms that are used. This has to be done now (during linking). * Code generation doesn't happen until the first time this shader is diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp index d0e378b76ef..81039ab0bc2 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp @@ -1007,11 +1007,6 @@ vec4_visitor::visit(ir_variable *ir) void vec4_visitor::visit(ir_loop *ir) { - /* Any normative loop bounds should have been lowered by - * lower_bounded_loops(). - */ - assert(ir->normative_bound < 0); - /* We don't want debugging output to print the whole body of the * loop as the annotation. */ diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp index 583cdef9f26..ad6c242e4d5 100644 --- a/src/mesa/program/ir_to_mesa.cpp +++ b/src/mesa/program/ir_to_mesa.cpp @@ -759,11 +759,6 @@ ir_to_mesa_visitor::visit(ir_variable *ir) void ir_to_mesa_visitor::visit(ir_loop *ir) { - /* Any normative loop bounds should have been lowered by - * lower_bounded_loops(). - */ - assert(ir->normative_bound < 0); - emit(NULL, OPCODE_BGNLOOP); visit_exec_list(&ir->body_instructions, this); @@ -3057,8 +3052,6 @@ _mesa_ir_link_shader(struct gl_context *ctx, struct gl_shader_program *prog) progress = lower_vector_insert(ir, true) || progress; } while (progress); - lower_bounded_loops(ir); - validate_ir_tree(ir); } diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index 18d2a5b0a41..a1ee24f6693 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -1137,11 +1137,6 @@ glsl_to_tgsi_visitor::visit(ir_variable *ir) void glsl_to_tgsi_visitor::visit(ir_loop *ir) { - /* Any normative loop bounds should have been lowered by - * lower_bounded_loops(). - */ - assert(ir->normative_bound < 0); - emit(NULL, TGSI_OPCODE_BGNLOOP); visit_exec_list(&ir->body_instructions, this); @@ -5307,8 +5302,6 @@ st_link_shader(struct gl_context *ctx, struct gl_shader_program *prog) } while (progress); - lower_bounded_loops(ir); - validate_ir_tree(ir); } |