Hi girish,<br><br>You can reference scalar transformation code under lib/Transforms/Scalar for some hints, such as LoopDeletion.cpp.<br>As your transformation may cause CFG be changed, you should make sure you are not "AU.setPreservesCFG()".<br>
<br><div class="gmail_quote">On 25 January 2012 01:06, Anton Korobeynikov <span dir="ltr"><<a href="mailto:anton@korobeynikov.info">anton@korobeynikov.info</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">>> br2uncond->eraseFromParent(). This results in br1cond loosing it's<br>
>> label/offset. How could I resolve this?<br>
> Your code is broken. AnalyzeBranch should not modify anything.<br>
><br>
> I was taking a clue from Mips/MipsInstrInfo.cpp: AnalyzeBranch :(<br>
> Could you please suggest appropriate alternative place for such a<br>
> modification?<br>
</div>Ah sorry, my memory served me wrong. You can modify the stuff there,<br>
but very careful :)<br>
It's hard to tell w/o seeing the actual code. But I don't see how<br>
inserting new instruction inside MBB might invalidate the BB<br>
destinations of other stuff.<br>
<br>
If you're doing more complex stuff (e.g. insert / remove BBs), then<br>
you should carefully update all possible references.<br>
<div class="HOEnZb"><div class="h5"><br>
--<br>
With best regards, Anton Korobeynikov<br>
Faculty of Mathematics and Mechanics, Saint Petersburg State University<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Sincerely,<br><br>Aries Wu<br><br>