[LLVMdev] Irreducible CFG from tail duplication

Eli Friedman eli.friedman at gmail.com
Thu Jul 24 15:38:55 PDT 2008


On Thu, Jul 24, 2008 at 2:00 PM, Mark Leone <markleone at gmail.com> wrote:
> Is irreducibility a problem for existing LLVM passes?

There aren't any LLVM passes that expect a reducible CFG at the
moment; of course, some passes are more effective with reducible CFGs.

> It looks like
> there was once an open project for a pass to make irreducible graphs
> reducible.  Was that ever implemented?

There isn't any such pass in trunk LLVM.  One could potentially be
added, but it would have to be a high-quality implementation, and we'd
have to measure the costs and benefits carefully.

> ; "opt -inline -tailduplicate" makes an irreducible CFG from this code

I can't reproduce the issue, and I can't see how tailduplicate could
possibly make your function irreducible, since it shouldn't be able to
introduce a loop into a function without any loops.  Can you include
the output you're getting, and point out the issue?

I guess it's worth pointing out that in trunk LLVM, the tailduplicate
pass has been removed from the standard set of passes run by llvm-gcc
and opt -std-compile-opts.

-Eli



More information about the llvm-dev mailing list