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: ifcvt/crossjump patch: Fix PR 42496, 21803


On 07/20/10 14:42, Bernd Schmidt wrote:
On 04/20/2010 12:05 AM, Eric Botcazou wrote:
Bernd Schmidt 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.  And other transformations should already be
able to apply this kind of optimizations.  Do you have testcases?
Here's a new patch.  A testcase is included; as I mentioned before this
triggers quite frequently.  This is PR44374.

I've moved and reused code from dead_or_predicable for a new function
can_move_insns_across.  The tests in dead_or_predicable were still
somewhat ad-hoc, after the patch I believe it's using the exact
necessary and sufficient conditions for moving code.

Bootstrapped and regression tested on i686-linux. Ok?
Was this the last version of the patch? It looks pretty good to me.

jeff


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