i am getting seg fault on functions like I->eraseFromParent also.<div>I'm assuming that the problem comes when i change the loop structure.<br><br><div class="gmail_quote">On Thu, Nov 18, 2010 at 4:05 AM, Sreeraj a <span dir="ltr"><<a href="mailto:writetosrj@gmail.com">writetosrj@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">The funny thing is that i am manually able to hoist the Loop invariant instruction to the basicBlock terminator, by editing the human readable form and then using llvm-as to convert it into bytecode.<div>
<div></div><div class="h5"><div><br></div><div><br>
<div class="gmail_quote">On Thu, Nov 18, 2010 at 4:01 AM, Chris Lattner <span dir="ltr"><<a href="mailto:clattner@apple.com" target="_blank">clattner@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div><br>
On Nov 17, 2010, at 1:38 PM, Sreeraj a wrote:<br>
<br>
> Thanks Chris,<br>
><br>
> I was able to weed out loop invariant arithmetic instructions using isLoopInvariant function.<br>
>  when i try to do an instruction->moveBefore(bb->getTerminator()) i'm getting a seg fault.<br>
> any obvious reasons that i'm missing out on?<br>
<br>
</div>No idea, sorry.<br>
<font color="#888888"><br>
-Chris<br>
<br>
</font></blockquote></div><br></div>
</div></div></blockquote></div><br></div>