This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][PR 59521] Respect probabilities when expanding switch statement


On Thu, Jul 20, 2017 at 8:41 PM, Steven Bosscher <stevenb.gcc@gmail.com> wrote:
> On Tue, Jul 18, 2017 at 9:04 AM, Yuri Gribov wrote:
>> Hi all,
>>
>> Currently all cases in switch statement are treated as having equal
>> probabilities which causes suboptimal code as demonstrated in
>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59521 . This patch
>> modifies expander to select pivot point for decision tree so that
>> probabilities of cases on the left are roughly equal to probabilities
>> on the right.
>>
>> Patch survives bootstrap and regtesting on x64 but has some issues:
>> * tests are fragile but I'm not sure how to make them better
>> * I haven't done any performance measurements - would these be needed?
>> I don't have access to SPEC these days, any other suggestions?
>>
>> Patch is jointly authored with Martin.
>
> Hi Yuri,
>
> Can you come up with test cases that don't scan the assembly output?
> Ideally the test case should check a dump file that is as close as
> possible to the code transformation, in this case the dump from
> pass_expand.

Sure, can do (it won't help much about test fragility though).

-Y


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]