This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: ifcvt/crossjump patch: Fix PR 42496, 21803
On Tue, Apr 20, 2010 at 12:05 AM, Eric Botcazou <ebotcazou@adacore.com> wrote:
>> Here's the second part. ?This one should help most architectures, not
>> just the ones with conditional execution. ?I've observed it helps on
>> i686 and arm, with the following being a typical result:
>>
>> ?.L18:
>> ? ? ? ? ldr ? ? r1, [r2, #4]
>> ? ? ? ? cmp ? ? r1, #34
>> - ? ? ? it ? ? ?hi
>> - ? ? ? ldrhi ? r3, .L98+12
>> - ? ? ? bhi ? ? .L28
>> ? ? ? ? ldr ? ? r3, .L98+12
>> + ? ? ? bhi ? ? .L28
>> ? ? ? ? ldrb ? ?r2, [r3, #4] ? ?@ zero_extendqisi2
>> ? ? ? ? cbz ? ? r2, .L29
>> ? ? ? ? ldr ? ? r3, [r3, #8]
>
> I'm uncomfortable with this patch because I'm not sure it belongs in ifcvt.c.
> Conceptually it's a reversed form of cross jumping so it could be implemented
> more generally in cfgcleanup.c.
I have a patch somewhere for this "head merging" (opposite of tail
merging). It implements this in cfgcleanup.c. I intend to finish it in
this stage1 cycle. It needs a bit of TLC but it's conceptually quite
easy.
> ?And other transformations should already be
> able to apply this kind of optimizations. ?Do you have testcases?
I originally wrote my patch for gtype-desc.c (in the build directory).
There are lots of cases for head-merging calls to the marker functions
there. See