<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On May 8, 2013, at 5:06 AM, zhiyuan yang <<a href="mailto:sjtu.yzy@gmail.com">sjtu.yzy@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div dir="ltr"><div><span style="font-family: arial, sans-serif; font-size: 13px;">Sorry for forgetting to reply all...</span></div><div><span style="font-family: arial, sans-serif; font-size: 13px;"><br></span></div><span style="font-family: arial, sans-serif; font-size: 13px;">It works! Thank you very much! </span><div style="font-family: arial, sans-serif; font-size: 13px;"><br></div><div style="font-family: arial, sans-serif; font-size: 13px;">But I also wonder how do you know this function will work while there are no documents noticing that. I try learning LLVM by reading its code, but soon feel lost in so many functions. Just like I have many tools, but don't know which to use and what difference it could make. Is there some better ways to learn LLVM?</div></div></div></blockquote><div><br></div>These kind of API details are best documented in comments attached to public interfaces. In your case, you needed to find a pass doing the same thing, e.g. LoopUnroll, and follow its example.</div><div><br></div><div>-Andy</div><div><br><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, May 8, 2013 at 1:02 PM, Andrew Trick<span class="Apple-converted-space"> </span><span dir="ltr"><<a href="mailto:atrick@apple.com" target="_blank">atrick@apple.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div style="word-wrap: break-word;"><br><div><div><div class="h5"><div>On May 7, 2013, at 8:26 PM, zhiyuan yang <<a href="mailto:sjtu.yzy@gmail.com" target="_blank">sjtu.yzy@gmail.com</a>> wrote:</div><br><blockquote type="cite"><div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div dir="ltr">Hi,<div><br></div><div>I am writing a loop pass to replace the backedge with an edge from latch to exit. </div><div>Now I just replace the terminator of latch with another BranchInst, and the loop will not be a loop after my pass. However, it turns out a failure of loopverify after executing my pass:</div><div><br></div><div>opt: ~/llvm/llvm-trunk/include/llvm/Analysis/LoopInfoImpl.h:297: void llvm::LoopBase<N, M>::verifyLoop() const [with BlockT = llvm::BasicBlock, LoopT = llvm::Loop]: Assertion `HasInsideLoopPreds && "Loop block has no in-loop predecessors!"' failed.<br></div><div><div><br></div><div>Does this mean I should keep it still a loop after my pass? If so, how could I bypass it?</div></div></div></div></blockquote><div><br></div></div></div><div>You might need to call LPPassManager::deleteLoopFromQueue().</div><div><br></div><div>-Andy</div></div><div><br><blockquote type="cite"><div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div class="im"><div dir="ltr">--<span> </span><br><div dir="ltr"><p style="line-height: 23px; font-size: 14px; font-family: 'lucida Grande', Verdana;"><b><i><span style="font-size: 10pt; color: blue;">Thank you && Best Regards,</span></i></b></p><p style="line-height: 23px; font-size: 14px; font-family: 'lucida Grande', Verdana;"><font color="#0000ff" style="line-height: 1.5;"><b><i>Zhiyuan Yang</i></b></font></p></div></div></div>_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a><span> </span>        <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></div></blockquote></div><br></div></blockquote></div><br><br clear="all"><div><br></div>--<span class="Apple-converted-space"> </span><br><div dir="ltr"><p style="line-height: 23px; font-size: 14px; font-family: 'lucida Grande', Verdana;"><b><i><span style="font-size: 10pt; color: blue;">Thank you && Best Regards,</span></i></b></p><p style="line-height: 23px; font-size: 14px; font-family: 'lucida Grande', Verdana;"><font color="#0000ff" style="line-height: 1.5;"><b><i>Zhiyuan Yang</i></b></font></p></div></div></div></div></blockquote></div><br></body></html>