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

Anton Korobeynikov anton at korobeynikov.info
Tue Jan 24 09:06:34 PST 2012


>> 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



More information about the llvm-dev mailing list