[LLVMdev] Irreducibility and the -simplifycfg flag

Duncan Sands baldrick at free.fr
Tue Jun 30 06:20:08 PDT 2009


> As a test for the algorithm I've been producing LLVM bitcode for C files in
> the GNU coreutils package. When generating bitcode, I find that sometimes
> the CFG produced can have basic blocks that have no successors or
> predecessors; using "-view-cfg-only" they just float around on their own,
> unconnected to anything in the dot file. This causes upset in the algorithm
> at the moment, so I was overcoming the problem by running "-simplify-cfg"
> before structural analysis takes place.
> My question is this: would the simplify pass ever make a reducible CFG
> become irreducible? My current inkling is towards no from what I can see in
> the source code and the documentation. However I was wondering if someone
> with more experience and understanding of the pass could share some wisdom!
> If it does, is there a simpler "clean-up" pass that I could run?

you can always write your own mini-pass that just dumps unreachable
basic blocks.



More information about the llvm-dev mailing list