[llvm-commits] [Review request] [PR8714] Jump threading of indirectbr blocks (and more)

Frits van Bommel fvbommel at gmail.com
Sat Dec 4 02:05:13 PST 2010


On Thu, Dec 2, 2010 at 6:10 PM, Frits van Bommel <fvbommel at gmail.com> wrote:
> While working on this I noticed that "opt -O3" turned the phi in my
> original testcase into a select and didn't further optimize it, so
> that the indirectbr wasn't eliminated. To fix this, patch #5 teaches
> SimplifyCFG (which created the select) to simplify (indirectbr (select
> cond, blockaddress(@fn, BlockA), blockaddress(@fn, BlockB))) to (br
> cond, BlockA, BlockB). Patch #4 is a test for this.

I'm pretty sure there was a bug in this one, relating to selects with
equal operands. I don't think it was updating the successors correctly
in this case. I can't seem to find a testcase that breaks because of
it though.

Anyway, here's an updated version of #5 that should avoid it.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 005-simplifycfg-indirectbr-of-select-v2.patch
Type: text/x-patch
Size: 3940 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20101204/9a0ed1d3/attachment.bin>


More information about the llvm-commits mailing list