This is the mail archive of the
mailing list for the GCC project.
Re: [patch] conditional store elimination
- From: Tehila Meyzels <TEHILA at il dot ibm dot com>
- To: Michael Matz <matz at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 11 Oct 2007 12:04:41 +0200
- Subject: Re: [patch] conditional store elimination
On 8/28/07, Michael Matz <firstname.lastname@example.org> wrote:
>this patch fixes PR middle-end/27313 and thereby a performance problem on
>456.hmmer (which now runs in 798 instead of 1080 seconds, i.e. 26%
>improvement). We talked about how to integrate this better with if
>conversion and make it also do load hoisting, but I fear we won't get to
>that during the time left for stage 2, and meanwhile I'd really like to
>have that improvement in 4.3.
>I tweaked the patch a bit to only do the transformation by default if the
>target has conditional moves.
Sorry, but I didn't find where in the patch you are checking this.
Could you please enlighten?
> Additionally it now is applied only when
>the store in question is non-trapping because of another shadowing mem
>access, which then also means that the value is in cache already (i.e. I
>don't do it when only TREE_NOTRAP is set).
>For reference again, here is what the transformation does:
> ... some access to *p ...
> if (cond)
> *p = X;
> cstore = *p;
> if (cond)
> cstore = X;
> *p = cstore;
There is another option, that will prevent the need of speculative load
(and hence all the trapping/non trapping check):
You can transform:
*p = X;
q (points to a dummy stack slot)
*q = X;
i.e., choose the address (that you store to) instead of the value.
Few other points...
What do you think about extending this to handle few conditional stores
not only one)?
What is your opinion that also conditional load hoisting will be included
>Later passes then have the possibility to transform the if into a
>conditional store (and transforming the *p read to a copy).
>Bootstrapped and tested (all langs except ada) on x86_64-linux.
FYI, I intend to check it also on SPU. Will keep you posted... :-)