<p class="MsoNormal">Thank you for your reply</p>
Yes, I change them, <span style="text-align:-webkit-auto;word-spacing:0px">so what should I do for another loops?</span><br><br><div class="gmail_quote">On Mon, Dec 12, 2011 at 7:54 PM, neda 8664 <span dir="ltr"><<a href="mailto:neda8664@gmail.com">neda8664@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<p class="MsoNormal">
</p><p class="MsoNormal">Thank you for your reply</p>
<p class="MsoNormal">Yes, I change them, <span style="text-align:-webkit-auto;word-spacing:0px">so what should I do for another loops?</span><span dir="RTL" style="font-family:"Arial","sans-serif"" lang="AR-SA"></span></p>
<div class="HOEnZb"><div class="h5">
<br><div class="gmail_quote">On Mon, Dec 12, 2011 at 7:42 PM, John Criswell <span dir="ltr"><<a href="mailto:criswell@illinois.edu" target="_blank">criswell@illinois.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"><div>
On 12/12/11 9:59 AM, neda 8664 wrote:
<blockquote type="cite">
hi all,<br>
<br>
I want access to all basic blocks of function in a loop, so I used
the following code:<br>
<br>
<font size="1"><i>bool parallel::runOnLoop(Loop *L, LPPassManager
&LPM)<br>
{<br>
for (Function::iterator bi= func->begin(); bi !=
func->end(); bi++){<br>
//<br>
}<br>
}</i></font><br>
</blockquote>
<br></div>
Are you modifying anything within this code (especially changes that
add/remove basic blocks or change their Terminator instructions)?
Depending on what you're doing, you may be invalidating the basic
block iterator bi.<br>
<br>
-- John T.<br>
<br>
<blockquote type="cite"><div><br>
First loop run without problem, but for second loop I get the
following error:<br>
<br>
<i><font size="1">0 <a href="http://libLLVM-2.9.so" target="_blank">libLLVM-2.9.so</a> 0x0137d530<br>
1 <a href="http://libLLVM-2.9.so" target="_blank">libLLVM-2.9.so</a>
0x0137fa6c<br>
2 0x002a7400 __kernel_sigreturn + 0<br>
3 parallel.so 0x002895e9 parallel::runOnLoop(llvm::Loop*,
llvm::LPPassManager&) + 345<br>
4 <a href="http://libLLVM-2.9.so" target="_blank">libLLVM-2.9.so</a>
0x00982994
llvm::LPPassManager::runOnFunction(llvm::Function&) + 1156<br>
5 <a href="http://libLLVM-2.9.so" target="_blank">libLLVM-2.9.so</a>
0x00eb02c1
llvm::FPPassManager::runOnFunction(llvm::Function&) + 545<br>
6 <a href="http://libLLVM-2.9.so" target="_blank">libLLVM-2.9.so</a>
0x00eb03d7 llvm::FPPassManager::runOnModule(llvm::Module&)
+ 87<br>
7 <a href="http://libLLVM-2.9.so" target="_blank">libLLVM-2.9.so</a>
0x00eafde5 llvm::MPPassManager::runOnModule(llvm::Module&)
+ 517<br>
8 <a href="http://libLLVM-2.9.so" target="_blank">libLLVM-2.9.so</a>
0x00eaff8b llvm::PassManagerImpl::run(llvm::Module&) + 171<br>
9 <a href="http://libLLVM-2.9.so" target="_blank">libLLVM-2.9.so</a>
0x00eb008d llvm::PassManager::run(llvm::Module&) + 45<br>
10 opt 0x0805b32f main + 5295<br>
11 libc.so.6 0x002becc6 __libc_start_main + 230<br>
12 opt 0x0804ff51<br>
Stack dump:<br>
0. Program arguments: opt -dse -lda -memdep -basicaa
-libcall-aa -scev-aa -globalsmodref-aa -load
/home/llvm/src/Release+Debug+Profile+Asserts/lib/parallel.so
-parallel -dot-cfg obj.o -o out.o<br>
1. Running pass 'Function Pass Manager' on module 'obj.o'.<br>
2. Running pass 'Loop Pass Manager' on function '@main'<br>
3. Running pass 'parallel World Pass' on basic block '%bb4'<br>
Segmentation fault (core dumped)</font></i><br>
<br>
<fieldset></fieldset>
<br>
</div><pre>_______________________________________________
LLVM Developers mailing list
<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>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
</pre>
</blockquote>
<br>
</div>
</blockquote></div><br>
</div></div></blockquote></div><br>