This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: improved RTL-level if conversion using scratchpads [half-hammock edition]
- From: Bernd Schmidt <bschmidt at redhat dot com>
- To: Abe <abe_skolnik at yahoo dot com>
- Cc: Sebastian Pop <sebpop at gmail dot com>, Kyrill Tkachov <kyrylo dot tkachov at arm dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 11 Nov 2015 16:01:04 +0100
- Subject: Re: improved RTL-level if conversion using scratchpads [half-hammock edition]
- Authentication-results: sourceware.org; auth=none
- References: <563BE9A7 dot 30803 at yahoo dot com> <563C8748 dot 3040901 at redhat dot com> <563CDCAF dot 20703 at yahoo dot com> <563CE5C2 dot 5060409 at redhat dot com> <56426336 dot 1020409 at yahoo dot com>
On 11/10/2015 10:35 PM, Abe wrote:
I wrote:
What I'm saying is I don't see a reason for a "definitely always
unsafe" state.
Why would any access not be made safe if a scratchpad is used?
Because the RTL if-converter doesn`t "know" how to convert
{everything that can be made safe using a scratchpad and is unsafe
otherwise}. My patch is only designed to enable the conversion of
half-hammocks with a single may-trap store.
Yeah, but how is that relevant to the question of whether a MEM is safe?
The logic should be
if mem is safe and we are allowed to speculate -> just do it
otherwise mem is unsafe, so
if we have prereqs like conditional moves -> use scratchpads
otherwise fail
I don't see how a three-state property for a single MEM is necessary or
helpful, and the implementation in the patch just roughly distinguishes
between two different types of trap (invalid address vs. readonly
memory). That seems irrelevant both to the question of whether something
is safe or not, and to the question of whether we know how to perform
the conversion.
You might argue that something that is known readonly will always fail
if written to at runtime, but that's no different from any other kind of
invalid address, and using a scratchpad prevents the write unless it
would have happened without if-conversion.
In summary, the 3 possible analysis outcomes are something like this:
* safe even without a scratchpad
* only safe with a scratchpad, and we _do_ know how to convert it
safely
* currently unsafe because we don`t yet know how to convert it
safely
This could be seen as a property of the block being converted, and is
kind of implicit in the algorithm sketched above, but I don't see how it
would be a property of the MEM that represents the store.
Do you have performance numbers anywhere?
I think my analysis work so far on this project is not yet complete
enough for public review, mainly because it does not include the
benefit of profiling.
I think performance numbers are a fairly important part of a submission
like this where the transformation isn't an obvious improvement (as
opposed to removing an instruction or suchlike).
Bernd