[llvm-commits] [llvm-gcc-4.2] r85513 - in /llvm-gcc-4.2/trunk/gcc: llvm-convert.cpp llvm-internal.h
Bob Wilson
bob.wilson at apple.com
Thu Oct 29 13:47:03 PDT 2009
On Oct 29, 2009, at 1:39 PM, Duncan Sands wrote:
> Hi Bob,
>
>> Add front-end support for indirect branch. This is mostly copied
>> from
>> the corresponding code that Chris wrote for clang. For now, this
>> is still
>> disabled by default; compile with USEINDIRECTBRANCH defined to
>> enable it.
>
> this looks awfully complicated. Does something like dragonegg
> commit r85525
> not work for llvm-gcc?
I don't think it's any more complicated than what was there before.
The patch looks messy because instead of modifying the existing
implementation, I added the alternate version inside conditionals. As
you've discovered, there is no codegen support yet so it should not be
enabled by default.
Besides consistency with clang, the idea behind doing it this way is
to reduce the number of edges in the CFG. Indirect branches are
typically used in things like interpreter loops, where you have a
large number of labels and a large number of gotos. If you add an
edge from every goto to every label, the CFG can blow up. Instead we
have a single indirect branch and all the gotos branch to it,
basically factoring out the CFG.
More information about the llvm-commits
mailing list