zhiyuan yang
2013-May-08 03:26 UTC
[LLVMdev] How to avoid loopverify failures after replacing the backedge with an edge(latchBB to exitBB) in a looppass?
Hi, I am writing a loop pass to replace the backedge with an edge from latch to exit. 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: 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. Does this mean I should keep it still a loop after my pass? If so, how could I bypass it? -- *Thank you && Best Regards,* *Zhiyuan Yang* -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130508/8c090e6f/attachment.html>
Andrew Trick
2013-May-08 05:02 UTC
[LLVMdev] How to avoid loopverify failures after replacing the backedge with an edge(latchBB to exitBB) in a looppass?
On May 7, 2013, at 8:26 PM, zhiyuan yang <sjtu.yzy at gmail.com> wrote:> Hi, > > I am writing a loop pass to replace the backedge with an edge from latch to exit. > 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: > > 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. > > Does this mean I should keep it still a loop after my pass? If so, how could I bypass it?You might need to call LPPassManager::deleteLoopFromQueue(). -Andy> -- > Thank you && Best Regards, > > Zhiyuan Yang > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130507/a54cae2f/attachment.html>
zhiyuan yang
2013-May-08 12:06 UTC
[LLVMdev] How to avoid loopverify failures after replacing the backedge with an edge(latchBB to exitBB) in a looppass?
Sorry for forgetting to reply all... It works! Thank you very much! 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? On Wed, May 8, 2013 at 1:02 PM, Andrew Trick <atrick at apple.com> wrote:> > On May 7, 2013, at 8:26 PM, zhiyuan yang <sjtu.yzy at gmail.com> wrote: > > Hi, > > I am writing a loop pass to replace the backedge with an edge from latch > to exit. > 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: > > 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. > > Does this mean I should keep it still a loop after my pass? If so, how > could I bypass it? > > > You might need to call LPPassManager::deleteLoopFromQueue(). > > -Andy > > -- > > *Thank you && Best Regards,* > > *Zhiyuan Yang* > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > >-- *Thank you && Best Regards,* *Zhiyuan Yang* -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130508/db3fbbee/attachment.html>
Seemingly Similar Threads
- [LLVMdev] How to avoid loopverify failures after replacing the backedge with an edge(latchBB to exitBB) in a looppass?
- [LLVMdev] How to avoid loopverify failures after replacing the backedge with an edge(latchBB to exitBB) in a looppass?
- [LLVMdev] How to transform loop to if-else using LLVM?
- [LLVMdev] Is loop header required to have at least one predecessor outside the loop?
- [LLVMdev] LLVM Alias Analysis