girish gulawani
2012-Jan-24 14:27 UTC
[LLVMdev] Resolving branch instr with label "$BB0_-1"
Hi Aries. Thanks very much! Precisely this is the situation! There're two consecutive branches (br1cond and br2uncond). Inside of AnalyzeBranch, there's an opcode swap of br2uncond (ex. j_foward to j_backward). There I do BuildMI (newOpcode) and followed by br2uncond->eraseFromParent(). This results in br1cond loosing it's label/offset. How could I resolve this? Best regards, Girish. May be you have branched to a BB which has been deleted.> > >On 24 January 2012 20:16, girish gulawani <girishvg at yahoo.com> wrote: > > >> >>Hello All. >>On a particular target the back-end generates an instruction like: >>beqz r2, "$BB0_-1" >> >> >>Is it a back-end specific issue? Could someone please help me figure out how this gets resolved? What confuses me is, all other branches are correctly labelled and resolved! >> >> >>Thanks.Girish. >> >> >>_______________________________________________ >>LLVM Developers mailing list >>LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >>http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> >> > > >-- >Sincerely, > >Aries Wu > > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120124/0716c5e6/attachment.html>
Anton Korobeynikov
2012-Jan-24 16:34 UTC
[LLVMdev] Resolving branch instr with label "$BB0_-1"
> Precisely this is the situation! There're two consecutive branches (br1cond > and br2uncond). Inside of AnalyzeBranch, there's an opcode swap of br2uncond > (ex. j_foward to j_backward). There I do BuildMI (newOpcode) and followed by > 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. -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University
girish gulawani
2012-Jan-24 16:57 UTC
[LLVMdev] Resolving branch instr with label "$BB0_-1"
Hello Anton. Thanks for the comment.> Precisely this is the situation! There're two consecutive branches (br1cond >> and br2uncond). Inside of AnalyzeBranch, there's an opcode swap of br2uncond >> (ex. j_foward to j_backward). There I do BuildMI (newOpcode) and followed by >> 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? >Best regards, > >Girish.-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120124/0e1db35d/attachment.html>
Apparently Analagous Threads
- [LLVMdev] Resolving branch instr with label "$BB0_-1"
- [LLVMdev] Resolving branch instr with label "$BB0_-1"
- [LLVMdev] Resolving branch instr with label "$BB0_-1"
- [LLVMdev] Resolving branch instr with label "$BB0_-1"
- [LLVMdev] Resolving branch instr with label "$BB0_-1"