[LLVMdev] BasicBlock predecessors list

Cristianno Martins cristiannomartins at gmail.com
Tue Apr 3 19:49:55 PDT 2012


Hi there,  

I'm trying to get a list of predecessors of a BasicBlock. I'm using a code similar to that on here (http://llvm.org/docs/ProgrammersManual.html#iterate_preds), but it appears to be more nodes been iterating that it should. Now, when I print out the llvm IR, I get something like:
[…]
while.body:                                       ; preds = %7, %while.cond
[…]
for a code that have only a while loop. Ok, I can recognize the %while.cond block on the code, but the %7 block seems to be an extra BasicBlock (I mean, it is not directly represented in the IR) that holds only a copy of the branch instruction that ends the %while.cond block.  

Here is the question: is there any way that I could discard these blocks that are not represented in the IR?  

Thanks in advance,

--  
Cristianno Martins
PhD Student of Computer Science
University of Campinas
cmartins at ic.unicamp.br

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120403/09b8d67f/attachment.html>


More information about the llvm-dev mailing list