[LLVMdev] Resolving branch instr with label "$BB0_-1"

AriesWu dodohack at gmail.com
Tue Jan 24 09:26:26 PST 2012


Hi girish,

You can reference scalar transformation code under lib/Transforms/Scalar
for some hints, such as LoopDeletion.cpp.
As your transformation may cause CFG be changed, you should make sure you
are not "AU.setPreservesCFG()".

On 25 January 2012 01:06, Anton Korobeynikov <anton at korobeynikov.info>wrote:

> >> br2uncond->eraseFromParent(). This results in br1cond loosing it's
> >> label/offset. How could I resolve this?
> > Your code is broken. AnalyzeBranch should not modify anything.
> >
> > I was taking a clue from Mips/MipsInstrInfo.cpp: AnalyzeBranch :(
> > Could you please suggest appropriate alternative place for such a
> > modification?
> Ah sorry, my memory served me wrong. You can modify the stuff there,
> but very careful :)
> It's hard to tell w/o seeing the actual code. But I don't see how
> inserting new instruction inside MBB might invalidate the BB
> destinations of other stuff.
>
> If you're doing more complex stuff (e.g. insert / remove BBs), then
> you should carefully update all possible references.
>
> --
> With best regards, Anton Korobeynikov
> Faculty of Mathematics and Mechanics, Saint Petersburg State University
>



-- 
Sincerely,

Aries Wu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120125/bd95899a/attachment.html>


More information about the llvm-dev mailing list