<div dir="ltr">Hi,<div><br></div><div>I am looking at the code in lower_clip_distance.cpp</div><div><div>ir_visitor_status</div><div>lower_clip_distance_visitor::visit_leave(ir_call *ir)</div><div>{</div><div> void *ctx = ralloc_parent(ir);</div>
<div><br></div><div> const exec_node *formal_param_node = ir->callee->parameters.head;</div><div> const exec_node *actual_param_node = ir->actual_parameters.head;</div><div> while (!actual_param_node->is_tail_sentinel()) {</div>
<div> ir_variable *formal_param = (ir_variable *) formal_param_node;</div><div> ir_rvalue *actual_param = (ir_rvalue *) actual_param_node;</div><div><br></div><div> /* Advance formal_param_node and actual_param_node now so that we can</div>
<div> * safely replace actual_param with another node, if necessary, below.</div><div> */</div><div> formal_param_node = formal_param_node->next;</div><div> actual_param_node = actual_param_node->next;</div>
<div>....</div><div><br></div></div><div><br></div><div>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.</div>
<div>I think it should by simply while (actual_param_node) {</div><div>Also, what is the point of exec_node::get_head() and exec_node::get_next() accessor methods if they are not used?</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Tue, Aug 27, 2013 at 3:15 PM, Matt Turner <span dir="ltr"><<a href="mailto:mattst88@gmail.com" target="_blank">mattst88@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Tue, Aug 27, 2013 at 2:03 PM, Dominik Behr <<a href="mailto:dbehr@chromium.org">dbehr@chromium.org</a>> wrote:<br>
> I am not sure about MAX2, is it guaranteed to be converted to branchless<br>
> conditional assignment?<br>
<br>
</div>I don't think there's a guarantee, no. Using MAX2 just makes the code<br>
easier to immediately understand.<br>
</blockquote></div><br></div>