<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
On 4/30/11 8:52 AM, Bo Wu wrote:
<blockquote
cite="mid:BANLkTin2t_G-59jtu_HO7b1udmMB2t9yEg@mail.gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
In C code, if a loop is not a natural loop, that means its loop
body should at least have one label, right? In that case, some BB
out of the loop can jump to the loop body, so the loop has more
than on entry. <br>
</blockquote>
<br>
Off the top of my head, I would think you are right: a C label would
have to exist within the loop in order to have a jump from outside
the loop to the inside of the loop.<br>
<br>
That said, have you looked at the LLVM IR generated for the function
and determined that the loop meets all the criteria of a natural
loop? Just my two cents, but I think looking at the IR directly is
much more accurate than ensuring that your conclusion about C code
and natural loops is correct.<br>
<br>
-- John T.<br>
<br>
<blockquote
cite="mid:BANLkTin2t_G-59jtu_HO7b1udmMB2t9yEg@mail.gmail.com"
type="cite">
<div><br>
</div>
<div>Does LoopInfo guarantee to identify all natural loops? This
property is very important for my pass.</div>
<div><br>
</div>
<div>regards,</div>
<div>Bo<br>
<br>
<div class="gmail_quote">On Fri, Apr 29, 2011 at 11:50 PM,
Cameron Zwarich <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:zwarich@apple.com">zwarich@apple.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">
<div bgcolor="#FFFFFF">
<div>A natural loop is one whose header dominates all of
the nodes in the loop. There is probably some block
outside of the loop jumping to a block in the loop body.<br>
<br>
Cameron</div>
<div>
<div class="h5">
<div><br>
On Apr 29, 2011, at 7:43 PM, Bo Wu <<a
moz-do-not-send="true" href="mailto:bwu@cs.wm.edu"
target="_blank">bwu@cs.wm.edu</a>> wrote:<br>
<br>
</div>
<blockquote type="cite">
<div>Hi,
<div><br>
</div>
<div>I found that some loops can not be identified
by LoopInfo pass. For example, the loop at line
3094 of rdopt.c of benchmark 464.h264ref from
spec cpu2006 is not a loop or a child (pr
grandchild) of any loop in the loop list
generated by LoopInfo pass. The documentation of
LoopInfo says that it identifies natural loops,
who have exactly one entry point. But the IR of
this loops shows that it's header only has one
BB in preds. Does that mean LoopInfo can not
identify some natural loops?</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Bo <br clear="all">
<br>
-- <br>
Bo Wu<br>
<br>
Ph.D. student<br>
CAPS group<br>
Computer Science Department<br>
The College of William & Mary<br>
<a moz-do-not-send="true"
href="http://www.cs.wm.edu/%7Ebwu"
target="_blank">www.cs.wm.edu/~bwu</a><br>
<br>
<br>
</div>
</div>
</blockquote>
</div>
</div>
<blockquote type="cite">
<div><span>_______________________________________________</span><br>
<span>LLVM Developers mailing list</span><br>
<span><a moz-do-not-send="true"
href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>
<a moz-do-not-send="true"
href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a></span><br>
<span><a moz-do-not-send="true"
href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev"
target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a></span><br>
</div>
</blockquote>
</div>
</blockquote>
</div>
<br>
<br clear="all">
<br>
-- <br>
Bo Wu<br>
<br>
Ph.D. student<br>
CAPS group<br>
Computer Science Department<br>
The College of William & Mary<br>
<a moz-do-not-send="true" href="http://www.cs.wm.edu/%7Ebwu"
target="_blank">www.cs.wm.edu/~bwu</a><br>
<br>
<br>
</div>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a class="moz-txt-link-freetext" href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
</pre>
</blockquote>
<br>
</body>
</html>