[llvm-commits] PATCH: instcombine switch on select of constants to br

Frits van Bommel fvbommel at gmail.com
Mon Feb 28 01:50:44 PST 2011


On Mon, Feb 28, 2011 at 4:01 AM, Nick Lewycky <nicholas at mxc.ca> wrote:
> I kinda wish it didn't work this way. Here's what I have in mind:
>  1. fix llvm.org/PR774 (make the default case optional)
>  2. one optimization which finds switches that have two destinations and
> turns them into branches
>  3. one optimization which sees select (and other things) feeding into a
> switch and removes the impossible cases from the switch, possibly including
> the default case.
>
> That said, if I can't talk you into doing that much work, then this patch
> looks fine:

While that does sound like a good idea long-term, I probably won't
have time to implement all that before the 2.9 branch date.
I just committed this as r126647. For now this code should work fine,
and we can easily rip it back out if a more general solution is
implemented.




More information about the llvm-commits mailing list