<div dir="ltr">You could also just check to see if the block belongs to the same loop as the blocks in PHI.</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 14, 2017 at 2:49 PM, Ryan Taylor <span dir="ltr"><<a href="mailto:ryta1203@gmail.com" target="_blank">ryta1203@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 dir="ltr">I would compare depths, incoming block still might be inside a loop (nested loops).</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 14, 2017 at 2:47 PM, Friedman, Eli via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 8/14/2017 3:58 AM, Anastasiya Ruzhanskaya via llvm-dev wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello,<br>
Is it a convenient way except of somehow iterating from one block to another to find from which block I have initial incoming value and from which I have a changing incoming value (this is only for phi nodes with two incoming blocks)? Dominator tree requires to know one block and one block edge...this is not what I want. Is it valid to take two first instructions from two incoming blocks and see what dominates what?<br>
</blockquote>
<br>
You can use Loop::contains() to figure out whether a basic block is inside a loop.  I think that's what you're looking for?<span class="m_-1151178181015192260HOEnZb"><font color="#888888"><br>
<br>
-Eli<br>
<br>
-- <br>
Employee of Qualcomm Innovation Center, Inc.<br>
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project<br>
<br>
______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank" rel="noreferrer">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
</font></span></blockquote></div><br></div>
</div></div></blockquote></div><br></div>