public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Bin.Cheng" <amker.cheng@gmail.com>
To: Jeff Law <law@redhat.com>
Cc: Richard Biener <richard.guenther@gmail.com>,
	Steve Ellcey <sellcey@mips.com>,
		GCC Patches <gcc-patches@gcc.gnu.org>,
	james.greenhalgh@arm.com
Subject: Re: RFC: Patch for switch elimination (PR 54742)
Date: Wed, 13 Aug 2014 02:54:00 -0000	[thread overview]
Message-ID: <CAHFci2_vdMNhda7=mNP9_XhBLqMiwOC2c_nhqM-uSbESQn4dxA@mail.gmail.com> (raw)
In-Reply-To: <53EA7BD0.1030901@redhat.com>

On Wed, Aug 13, 2014 at 4:40 AM, Jeff Law <law@redhat.com> wrote:
> On 08/12/14 14:23, Richard Biener wrote:
>>
>> On August 12, 2014 8:31:16 PM CEST, Jeff Law <law@redhat.com> wrote:
>>>
>>> On 08/12/14 11:46, Steve Ellcey wrote:
>>>>
>>>> After talking to Jeff Law at the GCC Cauldron I have updated my
>>>
>>> switch
>>>>
>>>> shortcut plugin pass to try and address this optimization in the
>>>
>>> hopes of
>>>>
>>>> getting it added to GCC as a static pass.  I fixed the code to build
>>>
>>> with
>>>>
>>>> the various C++ changes that have been happening in GCC but the
>>>
>>> current
>>>>
>>>> version I have included in this email is not working yet.  When I run
>>>
>>> it
>>>>
>>>> on coremark I get errors like:
>>>>
>>>> core_state.c: In function 'core_bench_state':
>>>> core_state.c:43:8: error: size of loop 16 should be 13, not 5
>>>>    ee_u16 core_bench_state(ee_u32 blksize, ee_u8 *memblock,
>>>>           ^
>>>> core_state.c:43:8: error: bb 15 does not belong to loop 16
>>>> core_state.c:43:8: error: bb 113 does not belong to loop 16
>>>> core_state.c:43:8: error: bb 118 does not belong to loop 16
>>>> core_state.c:43:8: error: bb 117 does not belong to loop 16
>>>> (etc)
>>>>
>>>> Apparently there have been some changes to the loop information that
>>>> is built since GCC 4.9.  I had hoped that adding a call to
>>>
>>> fix_loop_structure
>>>>
>>>> after recalculating the dominance information would fix this but it
>>>
>>> didn't.
>>>>
>>>>
>>>> Does anyone have any ideas on how to fix up the loop information that
>>>
>>> my
>>>>
>>>> optimization has messed as it duplicates blocks?  I tried adding a
>>>
>>> call
>>>>
>>>> 'loop_optimizer_init (LOOPS_NORMAL)' before the fix_loop_structure
>>>
>>> but that
>>>>
>>>> did not seem to have any affect.
>>>
>>> Try setting the header & latch fields for the loop structure to NULL,
>>> then call loops_set_state (LOOPS_NEED_FIXUP).
>>
>>
>> But that is _not_ the appropriate way of keeping loops preserved!
>
> I think that's done when we've scrogged the loop beyond repair and want the
> structures rebuilt.  IIRC, that's what you recommended we do.

Sorry for disturbing with this patch irrelevant question.  If I
understand correctly, we are now trying best to preserve loop
structure and LOOPS_NEED_FIXUP still works.  My question is how we
decide when we can rebuild loop structure and when we need to preserve
it?  If there is meta data stored in loop structure, does that mean it
should never be re-built?

Thanks,
bin

>
> jeff

  parent reply	other threads:[~2014-08-13  2:54 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-12 17:47 Steve Ellcey
2014-08-12 17:56 ` Jakub Jelinek
2014-08-12 18:31 ` Jeff Law
2014-08-12 20:23   ` Richard Biener
2014-08-12 20:40     ` Jeff Law
2014-08-12 22:45       ` Steve Ellcey
2014-08-13 20:55         ` Sebastian Pop
2014-08-13 21:06           ` Jeff Law
2014-08-13 21:33             ` Sebastian Pop
2014-08-14 10:32             ` Richard Biener
2014-08-14 15:56               ` Jeff Law
2014-08-14 16:29                 ` David Malcolm
2014-08-14 16:21                   ` Jeff Law
2014-08-14 18:25                     ` Steve Ellcey
2014-08-14 18:45                       ` Sebastian Pop
2014-08-15 10:07                         ` Richard Biener
2014-08-15 13:26                           ` Jeff Law
2014-08-15 10:13                       ` Richard Biener
2014-08-15 10:44                         ` Richard Biener
2014-08-15 15:58                       ` Ramana Radhakrishnan
2014-08-13  2:54       ` Bin.Cheng [this message]
2014-08-13  9:52         ` Richard Biener
2014-08-14 17:45           ` Steve Ellcey
2014-08-13  9:44       ` Richard Biener
2014-09-03 21:22         ` Jeff Law
2014-09-04 12:57           ` Richard Biener
2014-09-04 13:07             ` Jakub Jelinek
2014-09-04 14:05               ` Richard Biener

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHFci2_vdMNhda7=mNP9_XhBLqMiwOC2c_nhqM-uSbESQn4dxA@mail.gmail.com' \
    --to=amker.cheng@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=james.greenhalgh@arm.com \
    --cc=law@redhat.com \
    --cc=richard.guenther@gmail.com \
    --cc=sellcey@mips.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).