This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Improve forward jump threading of switch statements (PR18046)
- From: Patrick Palka <patrick at parcs dot ath dot cx>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Jeff Law <law at redhat dot com>, Patrick Palka <patrick at parcs dot ath dot cx>
- Date: Fri, 29 Jul 2016 00:15:48 -0400
- Subject: Re: [PATCH] Improve forward jump threading of switch statements (PR18046)
- Authentication-results: sourceware.org; auth=none
- References: <20160729034603.16227-1-patrick@parcs.ath.cx>
On Thu, Jul 28, 2016 at 11:46 PM, Patrick Palka <patrick@parcs.ath.cx> wrote:
> This patch improves the forward jump threader's ability to thread
> GIMPLE_SWITCHes by making the VRP simplification callback attempt to
> determine which case label will be taken.
>
> For example, if the index operand of a switch has a value range ~[5,6]
> along some edge and the switch statement has no "case 5" or "case 6"
> label then this patch recognizes such a scenario as an opportunity for
> threading through the switch and to the switch's default bb.
Uh, sorry, this example I gave is completely bogus... Given a value
range of ~[5,6], "case 5" and "case 6" would have to be the only
non-default labels in the switch for threading to occur, which is how
the patch behaves.