public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/43920] Choosing conditional execution over conditional branches for code size in some cases.
       [not found] <bug-43920-4@http.gcc.gnu.org/bugzilla/>
@ 2011-04-05 10:05 ` vries at gcc dot gnu.org
  2011-04-05 10:13 ` vries at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: vries at gcc dot gnu.org @ 2011-04-05 10:05 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43920

--- Comment #5 from vries at gcc dot gnu.org 2011-04-05 10:04:48 UTC ---
Author: vries
Date: Tue Apr  5 10:04:44 2011
New Revision: 171976

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=171976
Log:
2011-04-05  Tom de Vries  <tom@codesourcery.com>

    PR target/43920
    * cfgcleanup.c (flow_find_cross_jump): Don't count USE or CLOBBER as
    insn.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cfgcleanup.c


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/43920] Choosing conditional execution over conditional branches for code size in some cases.
       [not found] <bug-43920-4@http.gcc.gnu.org/bugzilla/>
  2011-04-05 10:05 ` [Bug target/43920] Choosing conditional execution over conditional branches for code size in some cases vries at gcc dot gnu.org
@ 2011-04-05 10:13 ` vries at gcc dot gnu.org
  2011-04-05 10:34 ` vries at gcc dot gnu.org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: vries at gcc dot gnu.org @ 2011-04-05 10:13 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43920

--- Comment #6 from vries at gcc dot gnu.org 2011-04-05 10:12:17 UTC ---
Author: vries
Date: Tue Apr  5 10:12:14 2011
New Revision: 171977

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=171977
Log:
2011-04-05  Tom de Vries  <tom@codesourcery.com>

    PR target/43920
    * function.c (emit_use_return_register_into_block): New function.
    (thread_prologue_and_epilogue_insns): Use
    emit_use_return_register_into_block.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/function.c


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/43920] Choosing conditional execution over conditional branches for code size in some cases.
       [not found] <bug-43920-4@http.gcc.gnu.org/bugzilla/>
  2011-04-05 10:05 ` [Bug target/43920] Choosing conditional execution over conditional branches for code size in some cases vries at gcc dot gnu.org
  2011-04-05 10:13 ` vries at gcc dot gnu.org
@ 2011-04-05 10:34 ` vries at gcc dot gnu.org
  2011-04-05 13:02 ` vries at gcc dot gnu.org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: vries at gcc dot gnu.org @ 2011-04-05 10:34 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43920

--- Comment #7 from vries at gcc dot gnu.org 2011-04-05 10:33:16 UTC ---
Author: vries
Date: Tue Apr  5 10:33:13 2011
New Revision: 171978

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=171978
Log:
2011-04-05  Tom de Vries  <tom@codesourcery.com>

    PR target/43920
    * config/arm/arm.h (BRANCH_COST): Set to 1 for Thumb-2 when optimizing
    for size.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/arm/arm.h


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/43920] Choosing conditional execution over conditional branches for code size in some cases.
       [not found] <bug-43920-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2011-04-05 10:34 ` vries at gcc dot gnu.org
@ 2011-04-05 13:02 ` vries at gcc dot gnu.org
  2011-04-06  9:41 ` ramana at gcc dot gnu.org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: vries at gcc dot gnu.org @ 2011-04-05 13:02 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43920

--- Comment #8 from vries at gcc dot gnu.org 2011-04-05 13:01:55 UTC ---
Author: vries
Date: Tue Apr  5 13:01:50 2011
New Revision: 171986

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=171986
Log:
2011-04-05  Tom de Vries  <tom@codesourcery.com>

    PR target/43920
    * gcc.target/arm/pr43920-1.c: New test.

Added:
    trunk/gcc/testsuite/gcc.target/arm/pr43920-1.c
Modified:
    trunk/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/43920] Choosing conditional execution over conditional branches for code size in some cases.
       [not found] <bug-43920-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2011-04-05 13:02 ` vries at gcc dot gnu.org
@ 2011-04-06  9:41 ` ramana at gcc dot gnu.org
  2011-04-07  8:10 ` vries at gcc dot gnu.org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: ramana at gcc dot gnu.org @ 2011-04-06  9:41 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43920

--- Comment #9 from Ramana Radhakrishnan <ramana at gcc dot gnu.org> 2011-04-06 09:41:10 UTC ---
Author: ramana
Date: Wed Apr  6 09:41:07 2011
New Revision: 172031

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=172031
Log:
Fix commit for PR target/43920

Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.target/arm/pr43920-1.c


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/43920] Choosing conditional execution over conditional branches for code size in some cases.
       [not found] <bug-43920-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2011-04-06  9:41 ` ramana at gcc dot gnu.org
@ 2011-04-07  8:10 ` vries at gcc dot gnu.org
  2011-04-07  8:35 ` vries at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: vries at gcc dot gnu.org @ 2011-04-07  8:10 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43920

--- Comment #10 from vries at gcc dot gnu.org 2011-04-07 08:10:38 UTC ---
Author: vries
Date: Thu Apr  7 08:10:34 2011
New Revision: 172090

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=172090
Log:
2011-04-07  Tom de Vries  <tom@codesourcery.com>

    PR target/43920
    * cfgcleanup.c (equal_different_set_p, can_replace_by, merge_dir): New
    function.
    (old_insns_match_p): Change return type.  Replace return false/true with
    return dir_none/dir_both.  Use can_replace_by.
    (flow_find_cross_jump): Add dir_p parameter.  Init replacement direction
    from dir_p.  Register replacement direction in dir, last_dir and
    afterlast_dir.    Handle new return type of old_insns_match_p using
    merge_dir.  Return replacement direction in dir_p.
    (flow_find_head_matching_sequence, outgoing_edges_match): Handle new
    return type of old_insns_match_p.
    (try_crossjump_to_edge): Add argument to call to flow_find_cross_jump.
    * ifcvt.c ( cond_exec_process_if_block): Add argument to call to
    flow_find_cross_jump.
    * basic-block.h (enum replace_direction): New type.
    (flow_find_cross_jump): Add parameter to declaration.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/basic-block.h
    trunk/gcc/cfgcleanup.c
    trunk/gcc/ifcvt.c


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/43920] Choosing conditional execution over conditional branches for code size in some cases.
       [not found] <bug-43920-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2011-04-07  8:10 ` vries at gcc dot gnu.org
@ 2011-04-07  8:35 ` vries at gcc dot gnu.org
  2011-04-07  9:28 ` vries at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: vries at gcc dot gnu.org @ 2011-04-07  8:35 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43920

--- Comment #11 from vries at gcc dot gnu.org 2011-04-07 08:35:27 UTC ---
Author: vries
Date: Thu Apr  7 08:35:23 2011
New Revision: 172091

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=172091
Log:
2011-04-07  Tom de Vries  <tom@codesourcery.com>

    PR target/43920
    * cfgcleanup.c (walk_to_nondebug_insn): New function.
    (flow_find_cross_jump): Use walk_to_nondebug_insn.  Recalculate bb1 and
    bb2.
    (try_crossjump_to_edge): Handle case that newpos1 or newpos2 is not src1
    or src2.  Redirect edges to the last basic block.  Update frequency and
    count on multiple basic blocks in case of fallthru.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cfgcleanup.c


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/43920] Choosing conditional execution over conditional branches for code size in some cases.
       [not found] <bug-43920-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2011-04-07  8:35 ` vries at gcc dot gnu.org
@ 2011-04-07  9:28 ` vries at gcc dot gnu.org
  2011-04-07  9:48 ` vries at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: vries at gcc dot gnu.org @ 2011-04-07  9:28 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43920

--- Comment #12 from vries at gcc dot gnu.org 2011-04-07 09:28:15 UTC ---
Author: vries
Date: Thu Apr  7 09:28:11 2011
New Revision: 172093

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=172093
Log:
2011-04-07  Tom de Vries  <tom@codesourcery.com>

    PR target/43920
    * lib/scanasm.exp (object-size): New proc.
    * gcc.target/arm/pr43920-2.c: New test.

Added:
    trunk/gcc/testsuite/gcc.target/arm/pr43920-2.c
Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/lib/scanasm.exp


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/43920] Choosing conditional execution over conditional branches for code size in some cases.
       [not found] <bug-43920-4@http.gcc.gnu.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2011-04-07  9:28 ` vries at gcc dot gnu.org
@ 2011-04-07  9:48 ` vries at gcc dot gnu.org
  2011-07-11 16:38 ` vries at gcc dot gnu.org
  2011-09-19  6:21 ` jye2 at gcc dot gnu.org
  10 siblings, 0 replies; 13+ messages in thread
From: vries at gcc dot gnu.org @ 2011-04-07  9:48 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43920

--- Comment #13 from vries at gcc dot gnu.org 2011-04-07 09:48:42 UTC ---
Author: vries
Date: Thu Apr  7 09:48:39 2011
New Revision: 172094

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=172094
Log:
2011-04-07  Tom de Vries  <tom@codesourcery.com>

    PR target/43920
    * cfgcleanup.c (try_crossjump_to_edge): Add dir parameter.  Pass dir to
    flow_find_cross_jump.  Swap variables to implement backward replacement.
    (try_crossjump_bb): Add argument to try_crossjump_to_edge.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cfgcleanup.c


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/43920] Choosing conditional execution over conditional branches for code size in some cases.
       [not found] <bug-43920-4@http.gcc.gnu.org/bugzilla/>
                   ` (8 preceding siblings ...)
  2011-04-07  9:48 ` vries at gcc dot gnu.org
@ 2011-07-11 16:38 ` vries at gcc dot gnu.org
  2011-09-19  6:21 ` jye2 at gcc dot gnu.org
  10 siblings, 0 replies; 13+ messages in thread
From: vries at gcc dot gnu.org @ 2011-07-11 16:38 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43920

vries at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |vries at gcc dot gnu.org
            Version|4.6.0                       |4.7.0
         Resolution|                            |FIXED

--- Comment #14 from vries at gcc dot gnu.org 2011-07-11 16:38:12 UTC ---
Patches and test-cases are checked in into trunk. Marking bug fixed.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/43920] Choosing conditional execution over conditional branches for code size in some cases.
       [not found] <bug-43920-4@http.gcc.gnu.org/bugzilla/>
                   ` (9 preceding siblings ...)
  2011-07-11 16:38 ` vries at gcc dot gnu.org
@ 2011-09-19  6:21 ` jye2 at gcc dot gnu.org
  10 siblings, 0 replies; 13+ messages in thread
From: jye2 at gcc dot gnu.org @ 2011-09-19  6:21 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43920

--- Comment #15 from jye2 at gcc dot gnu.org 2011-09-19 06:17:54 UTC ---
Author: jye2
Date: Mon Sep 19 06:17:45 2011
New Revision: 178953

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=178953
Log:
2011-09-19  chengbin  <bin.cheng@arm.com>

    Backport r174035 from mainline
    2011-05-22  Tom de Vries  <tom@codesourcery.com>

    PR middle-end/48689
    * fold-const.c (fold_checksum_tree): Guard TREE_CHAIN use with
    CODE_CONTAINS_STRUCT (TS_COMMON).

    Backport r172297 from mainline
    2011-04-11  Chung-Lin Tang  <cltang@codesourcery.com>
        Richard Earnshaw  <rearnsha@arm.com>

    PR target/48250
    * config/arm/arm.c (arm_legitimize_reload_address): Update cases
    to use sign-magnitude offsets. Reject unsupported unaligned
    cases. Add detailed description in comments.
    * config/arm/arm.md (reload_outdf): Disable for ARM mode; change
    condition from TARGET_32BIT to TARGET_ARM.

    Backport r171978 from mainline
    2011-04-05  Tom de Vries  <tom@codesourcery.com>

    PR target/43920
    * config/arm/arm.h (BRANCH_COST): Set to 1 for Thumb-2 when optimizing
    for size.

    Backport r171632 from mainline
    2011-03-28  Richard Sandiford  <richard.sandiford@linaro.org>

    * builtins.c (expand_builtin_memset_args): Use gen_int_mode
    instead of GEN_INT.

    Backport r171379 from mainline
    2011-03-23  Chung-Lin Tang  <cltang@codesourcery.com>

    PR target/46934
    * config/arm/arm.md (casesi): Use the gen_int_mode() function
    to subtract lower bound instead of GEN_INT().

    Backport r171251 from mainline 
    2011-03-21  Daniel Jacobowitz  <dan@codesourcery.com>

    * config/arm/unwind-arm.c (__gnu_unwind_pr_common): Correct test
    for barrier handlers.

    Backport r171096 from mainline
    2011-03-17  Chung-Lin Tang  <cltang@codesourcery.com>

    PR target/43872
    * config/arm/arm.c (arm_get_frame_offsets): Adjust early
    return condition with !cfun->calls_alloca.


Modified:
    branches/ARM/embedded-4_6-branch/gcc/ChangeLog.arm
    branches/ARM/embedded-4_6-branch/gcc/builtins.c
    branches/ARM/embedded-4_6-branch/gcc/config/arm/arm.c
    branches/ARM/embedded-4_6-branch/gcc/config/arm/arm.h
    branches/ARM/embedded-4_6-branch/gcc/config/arm/arm.md
    branches/ARM/embedded-4_6-branch/gcc/config/arm/unwind-arm.c
    branches/ARM/embedded-4_6-branch/gcc/fold-const.c
    branches/ARM/embedded-4_6-branch/gcc/testsuite/gcc.target/arm/pr40887.c
    branches/ARM/embedded-4_6-branch/gcc/testsuite/gcc.target/arm/pr42575.c
    branches/ARM/embedded-4_6-branch/gcc/testsuite/gcc.target/arm/pr43698.c
    branches/ARM/embedded-4_6-branch/gcc/testsuite/gcc.target/arm/pr44788.c
    branches/ARM/embedded-4_6-branch/gcc/testsuite/gcc.target/arm/sync-1.c


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/43920] Choosing conditional execution over conditional branches for code size in some cases.
  2010-04-28  8:18 [Bug target/43920] New: A lot of instructions for condition (start == -1 || end == -1) carrot at google dot com
  2010-04-28  9:55 ` [Bug target/43920] Choosing conditional execution over conditional branches for code size in some cases ramana at gcc dot gnu dot org
@ 2010-04-29  2:24 ` carrot at google dot com
  1 sibling, 0 replies; 13+ messages in thread
From: carrot at google dot com @ 2010-04-29  2:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from carrot at google dot com  2010-04-29 02:23 -------
It is not only good to code size, but also benefit performance. For any path to
any successor block, the same number of taken branch executed, but less alu
instructions executed.

It may be difficult to calculate the tradeoff for an arbitrary condition
expression. But for a condition composed of a series of || or && operation,
such as
    if (A || B || C || ...)
or 
    if (A && B && C && ...)
This simplification is always beneficial.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43920


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/43920] Choosing conditional execution over conditional branches for code size in some cases.
  2010-04-28  8:18 [Bug target/43920] New: A lot of instructions for condition (start == -1 || end == -1) carrot at google dot com
@ 2010-04-28  9:55 ` ramana at gcc dot gnu dot org
  2010-04-29  2:24 ` carrot at google dot com
  1 sibling, 0 replies; 13+ messages in thread
From: ramana at gcc dot gnu dot org @ 2010-04-28  9:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from ramana at gcc dot gnu dot org  2010-04-28 09:55 -------
Confirmed though it isn't as simple as an "expand" time problem alone.


-- 

ramana at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |missed-optimization
      Known to fail|                            |4.5.0
   Last reconfirmed|0000-00-00 00:00:00         |2010-04-28 09:55:09
               date|                            |
            Summary|A lot of instructions for   |Choosing conditional
                   |condition (start == -1 ||   |execution over conditional
                   |end == -1)                  |branches for code size in
                   |                            |some cases.


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43920


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2011-09-19  6:20 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-43920-4@http.gcc.gnu.org/bugzilla/>
2011-04-05 10:05 ` [Bug target/43920] Choosing conditional execution over conditional branches for code size in some cases vries at gcc dot gnu.org
2011-04-05 10:13 ` vries at gcc dot gnu.org
2011-04-05 10:34 ` vries at gcc dot gnu.org
2011-04-05 13:02 ` vries at gcc dot gnu.org
2011-04-06  9:41 ` ramana at gcc dot gnu.org
2011-04-07  8:10 ` vries at gcc dot gnu.org
2011-04-07  8:35 ` vries at gcc dot gnu.org
2011-04-07  9:28 ` vries at gcc dot gnu.org
2011-04-07  9:48 ` vries at gcc dot gnu.org
2011-07-11 16:38 ` vries at gcc dot gnu.org
2011-09-19  6:21 ` jye2 at gcc dot gnu.org
2010-04-28  8:18 [Bug target/43920] New: A lot of instructions for condition (start == -1 || end == -1) carrot at google dot com
2010-04-28  9:55 ` [Bug target/43920] Choosing conditional execution over conditional branches for code size in some cases ramana at gcc dot gnu dot org
2010-04-29  2:24 ` carrot at google dot com

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).