<div dir="ltr">Sorry but that didn't make any difference. Loop is still infinite.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 10, 2015 at 2:47 PM, Nick Lewycky <span dir="ltr"><<a href="mailto:nicholas@mxc.ca" target="_blank">nicholas@mxc.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This is a bit of a long shot, but your loop looks fine, and I noticed a bug in one of the functions you call from your loop body. Try this for WaveScalar::setLabel:<br>
<br>
-     Twine twine(k);<br>
-     (*succ)->setName(twine);<br>
+     (*succ)->setName(Twine(k));<br>
<br>
and see whether that makes any difference?<br>
<br>
Nick<br>
<br>
Pranav Kant wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
Input to this pass is the bitcode format of simple code below :<br>
<br>
int sum_single_loop (int a){<br>
    int su = 0, i;<br>
    for (i=0;i<a;i++)<br>
       su = su + i;<br>
    return su;<br>
}<br>
<br>
<br>
On Mon, Feb 9, 2015 at 2:32 AM, David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a><br></span><span class="">
<mailto:<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>>> wrote:<br>
<br>
<br>
<br>
    On Sun, Feb 8, 2015 at 11:23 AM, Pranav Kant <<a href="mailto:pranav913@gmail.com" target="_blank">pranav913@gmail.com</a><br></span><span class="">
    <mailto:<a href="mailto:pranav913@gmail.com" target="_blank">pranav913@gmail.com</a>>> wrote:<br>
<br>
        So, you mean to say that the above implementation is correct and<br>
        should work fine.<br>
<br>
<br>
    So far as I can see - but I could be missing something.<br>
<br>
        I initially thought that the above way is not the correct way<br>
        anymore since 3.5.0 might have changed few things.<br>
<br>
        Anyways here is my dirty code I have written for my research<br>
        project that I took the above snippet from :<br>
<br>
        <a href="https://github.com/pranavk/spatial-computing/blob/master/waves.cpp#L105" target="_blank">https://github.com/pranavk/<u></u>spatial-computing/blob/master/<u></u>waves.cpp#L105</a><br>
<br>
<br>
    Someone (not necessarily me) will presumably need the<br>
    input/command/arguments/<u></u>whatever required to trigger the infinite<br>
    loop in this code that you're seeing, as well as the code there.<br>
<br>
<br>
<br>
<br>
        On Sun, Feb 8, 2015 at 10:25 PM, David Blaikie<br></span><span class="">
        <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a> <mailto:<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>>> wrote:<br>
<br>
            This may be difficult yo reproduce or debug without a more<br>
            complete (though preferably minimal) test case.<br>
<br>
            On Feb 8, 2015 8:31 AM, "Pranav Kant" <<a href="mailto:pranav913@gmail.com" target="_blank">pranav913@gmail.com</a><br></span><div><div class="h5">
            <mailto:<a href="mailto:pranav913@gmail.com" target="_blank">pranav913@gmail.com</a>>> wrote:<br>
<br>
                void Wave::init (const Function &F){<br>
                     Function::const_iterator ie = F.end();<br>
                     outs() << ie << "\n\n";<br>
                     for (Function::const_iterator I = F.begin(), IE =<br>
                F.end(); I != IE; I++, K++){<br>
                        outs() << I << "\n";<br>
                        // some manipulation with I<br>
                     }<br>
                }<br>
<br>
                I used the above shown function in my pass in LLVM 3.4.2<br>
                and it used to work fine but when I am compiling this<br>
                pass with 3.5.0, this is a never ending loop. Can<br>
                someone please suggest me what can be wrong here ?<br>
<br>
                Upon some debugging, I found out that const_iterator I<br>
                never becomes equal to IE, rather it goes past IE when<br>
                incremented and hence loop never ends.<br>
<br>
                Following is the output upon executing above code.<br>
<br>
                0x2e08248 <- address of ie<br>
                0x2e16630 <- address of I initially<br>
                0x2e08250 <- incremented I<br>
                0x2e165e0<br>
                0x2e16630<br>
                0x2e08250<br>
                0x2e165e0<br>
                0x2e16630<br>
                0x2e08250<br>
<br>
<br>
<br>
                --<br>
                Regards,<br>
                Pranav Kant,<br>
                Department of Computer Science<br>
                National Institute of Technology Hamirpur<br>
                <a href="http://pricked.in/" target="_blank">http://pricked.in/</a><br>
<br>
<br>
<br>
                --<br>
                Regards,<br>
                Pranav Kant,<br>
                Department of Computer Science<br>
                National Institute of Technology Hamirpur<br>
                <a href="http://pricked.in/" target="_blank">http://pricked.in/</a><br>
<br>
                ______________________________<u></u>_________________<br>
                LLVM Developers mailing list<br></div></div>
                <a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a> <mailto:<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>><span class=""><br>
                <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/<u></u>mailman/listinfo/llvmdev</a><br>
<br>
<br>
<br>
<br>
        --<br>
        Regards,<br>
        Pranav Kant,<br>
        Department of Computer Science<br>
        National Institute of Technology Hamirpur<br>
        <a href="http://pricked.in/" target="_blank">http://pricked.in/</a><br>
<br>
<br>
<br>
<br>
<br>
--<br>
Regards,<br>
Pranav Kant,<br>
Department of Computer Science<br>
National Institute of Technology Hamirpur<br>
<a href="http://pricked.in/" target="_blank">http://pricked.in/</a><br>
<br>
<br>
______________________________<u></u>_________________<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/<u></u>mailman/listinfo/llvmdev</a><br>
</span></blockquote>
<br>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div>Regards,<br>Pranav Kant,<br></div><div>Department of Computer Science<br>National Institute of Technology Hamirpur<br></div><div><a href="http://pricked.in/" target="_blank">http://pricked.in/</a><br></div></div></div>
</div>