This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Teach VRP to register assertions along default switch labels (PR 18046)
- From: Jeff Law <law at redhat dot com>
- To: Andrew Pinski <pinskia at gmail dot com>, Patrick Palka <patrick at parcs dot ath dot cx>
- Cc: kugan <kugan dot vivekanandarajah at linaro dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 25 Jul 2016 09:48:57 -0600
- Subject: Re: [PATCH] Teach VRP to register assertions along default switch labels (PR 18046)
- Authentication-results: sourceware.org; auth=none
- References: <firstname.lastname@example.org> <email@example.com> <CA+C-WL89DAjKTZekaGwL0cjURLrXpEGskh5ORho=y8nFA1_firstname.lastname@example.org> <CA+=Sn1me6UuSfNPV_JF6=BhwjVpEgt3-KjUAQ5Ls7xih5HqXjQ@mail.gmail.com>
On 07/24/2016 11:56 AM, Andrew Pinski wrote:
On Sun, Jul 24, 2016 at 9:49 AM, Patrick Palka <email@example.com> wrote:
On Sat, Jul 23, 2016 at 9:13 PM, kugan
On 23/07/16 05:26, Patrick Palka wrote:
This patch teaches VRP to register along a default switch label
assertions that corresponds to the anti range of each case label.
In case of a larger switch statement with case values that cannot be
combined, you could end up with very large number of ASSERT_EXPRs in the
default basic block. I am not sure if this would have any impact on compile
time/memory usage? If that is the case you might want to punt at some
That sounds like a good idea to me. So I gathered some info about the
number of assert_exprs inserted in the default bb during GCC bootstrap
with this patch:
Max # of asserts inserted in a default BB: 59
Median #: 2
Average #: 3.33817
Std. dev: 4.76926
95% percentile: 10
Based on the last point I guess 10 would be a good limit?
Make sure this is a parameter so someone can increase it if they want.
But 10 seems like a good default.
Agreed on both points.