Hi,<div><br></div><div>You might want to try running -loops -loop-simplify before loop unroll.</div><div><br></div><div>From loop simplify.cpp</div><div><span class="Apple-style-span" style="font-family: Fixed, monospace; font-size: 14px; "><pre class="fragment" style="font-family: Fixed, monospace; font-size: 13px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); background-color: rgb(245, 245, 245); margin-top: 4px; margin-bottom: 4px; margin-left: 2px; margin-right: 8px; padding-left: 6px; padding-right: 6px; padding-top: 4px; padding-bottom: 4px; ">

<span class="comment" style="color: rgb(128, 0, 0); ">This pass performs several transformations to transform natural loops into a</span>
<a name="l00011" style="color: rgb(37, 46, 120); "></a>00011 <span class="comment" style="color: rgb(128, 0, 0); ">// simpler form, which makes subsequent analyses and transformations simpler and</span>
<a name="l00012" style="color: rgb(37, 46, 120); "></a>00012 <span class="comment" style="color: rgb(128, 0, 0); ">// more effective.</span></pre></span><div><br></div>Arushi</div><div><br><div class="gmail_quote">On Tue, May 3, 2011 at 2:17 PM, Manish Gupta <span dir="ltr"><<a href="mailto:mgupta.iitr@gmail.com">mgupta.iitr@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">You mean like <div><br></div><div><b>llvm-gcc-4.2 -O2 -emit-llvm Hello.c -c -o Hello.bc</b></div><div><br></div><div>
But still i am not able to observe any effect on bit code by running </div>
<div><br></div><div><b>opt-2.8 -loop-unroll Hello.bc -o Hello_unroll.bc</b></div><div><div></div><div class="h5">

<div><br><div class="gmail_quote">On Tue, May 3, 2011 at 3:58 AM, Zakk <span dir="ltr"><<a href="mailto:zakk0610@gmail.com" target="_blank">zakk0610@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



Hi, you need to run some optimization passes first. (like -O2)<br><br><div class="gmail_quote"><div><div></div><div>2011/5/3 Manish Gupta <span dir="ltr"><<a href="mailto:mgupta.iitr@gmail.com" target="_blank">mgupta.iitr@gmail.com</a>></span><br>



</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div>
I just want to try loop-unroll and see corresponding changes in the bitcode file. For that any loop will do. Have you been able to test llvm loop-unroll successfully? <div><div></div><div><br><br><div class="gmail_quote">




On Mon, May 2, 2011 at 10:04 PM, Yuan Pengfei <span dir="ltr"><<a href="mailto:coolypf@qq.com" target="_blank">coolypf@qq.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<div><br>
> The loop that I am trying it on is:<br>
> for(i=0; i< 1000; i++)<br>
> {<br>
> c[i] = a[i] + b[i];<br>
> }<br>
<br>
</div>I can't find any benefit unrolling this loop.<br>
<br>
------------------<br>
<font color="#888888">Yuan Pengfei<br>
Peking Unversity, China</font></blockquote></div><br>
</div></div><br></div></div>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><font color="#888888"><br><br clear="all"><br>-- <br>Best regards,<br>Kuan-Hsu<br><br><br>
</font></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div>