Is it safe or legal to call isInsideBundle even when I == E? MachineBasicBlock::iterator MachineBasicBlock::getFirstNonPHI() { instr_iterator I = instr_begin(), E = instr_end(); while (I != E && I->isPHI()) ++I; assert(!I->isInsideBundle() && "First non-phi MI cannot be inside a bundle!"); return I; } I am seeing an assert when I run llc. The code is in lib/CodeGen/MachineBasicBlock.cpp:145. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121025/6e7238e1/attachment.html>
On Oct 25, 2012, at 7:01 PM, Akira Hatanaka <ahatanak at gmail.com> wrote:> Is it safe or legal to call isInsideBundle even when I == E?No, neither. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121025/cb0bdec9/attachment.html>
Please see the attached patch. There was one more line which was calling isInsideBundle without any check. On Thu, Oct 25, 2012 at 7:08 PM, Jakob Stoklund Olesen <stoklund at 2pi.dk>wrote:> > On Oct 25, 2012, at 7:01 PM, Akira Hatanaka <ahatanak at gmail.com> wrote: > > Is it safe or legal to call isInsideBundle even when I == E? > > > No, neither. >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121025/d11c04f2/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: instriter1.patch Type: application/octet-stream Size: 836 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121025/d11c04f2/attachment.obj>