Hi, I am looking at the code in lower_clip_distance.cpp ir_visitor_status lower_clip_distance_visitor::visit_leave(ir_call *ir) { void *ctx = ralloc_parent(ir);
const exec_node *formal_param_node = ir->callee->parameters.head; const exec_node *actual_param_node = ir->actual_parameters.head; while (!actual_param_node->is_tail_sentinel()) { ir_variable *formal_param = (ir_variable *) formal_param_node; ir_rvalue *actual_param = (ir_rvalue *) actual_param_node; /* Advance formal_param_node and actual_param_node now so that we can * safely replace actual_param with another node, if necessary, below. */ formal_param_node = formal_param_node->next; actual_param_node = actual_param_node->next; .... is_tail_sentinel() is true when next == NULL. this means this loop will not be executed for the last formal param in the list. Is this by design? In my case I need to visit all function parameters. I think it should by simply while (actual_param_node) { Also, what is the point of exec_node::get_head() and exec_node::get_next() accessor methods if they are not used? On Tue, Aug 27, 2013 at 3:15 PM, Matt Turner <matts...@gmail.com> wrote: > On Tue, Aug 27, 2013 at 2:03 PM, Dominik Behr <db...@chromium.org> wrote: > > I am not sure about MAX2, is it guaranteed to be converted to branchless > > conditional assignment? > > I don't think there's a guarantee, no. Using MAX2 just makes the code > easier to immediately understand. >
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev