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

Chris Lattner clattner at apple.com
Sun Dec 5 10:18:09 PST 2010


On Dec 4, 2010, at 2:05 AM, Frits van Bommel wrote:

> 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.

This patch looks great to me.  Please commit with a testcase, including for the "equal select" case.

-Chris



More information about the llvm-commits mailing list