This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Pushing out more LIM TLC patches
- From: Richard Biener <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 21 Mar 2013 13:34:17 +0100 (CET)
- Subject: [PATCH] Pushing out more LIM TLC patches
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.
Richard.
2013-03-21 Richard Biener <rguenther@suse.de>
* tree-ssa-loop-im.c (can_sm_ref_p): Do not test whether
ref is stored in the loop.
(find_refs_for_sm): Walk only over all stores.
(store_motion_loop): Allocate from lim_bitmap_obstack.
(store_motion): Likewise.
Index: trunk/gcc/tree-ssa-loop-im.c
===================================================================
*** trunk.orig/gcc/tree-ssa-loop-im.c 2013-03-14 11:50:55.000000000 +0100
--- trunk/gcc/tree-ssa-loop-im.c 2013-03-14 11:52:08.744186528 +0100
*************** can_sm_ref_p (struct loop *loop, mem_ref
*** 2315,2324 ****
if (!MEM_ANALYZABLE (ref))
return false;
- /* Unless the reference is stored in the loop, there is nothing to do. */
- if (!bitmap_bit_p (ref->stored, loop->num))
- return false;
-
/* It should be movable. */
if (!is_gimple_reg_type (TREE_TYPE (ref->mem.ref))
|| TREE_THIS_VOLATILE (ref->mem.ref)
--- 2315,2320 ----
*************** can_sm_ref_p (struct loop *loop, mem_ref
*** 2354,2360 ****
static void
find_refs_for_sm (struct loop *loop, bitmap sm_executed, bitmap refs_to_sm)
{
! bitmap refs = memory_accesses.all_refs_in_loop[loop->num];
unsigned i;
bitmap_iterator bi;
mem_ref_p ref;
--- 2350,2356 ----
static void
find_refs_for_sm (struct loop *loop, bitmap sm_executed, bitmap refs_to_sm)
{
! bitmap refs = memory_accesses.all_refs_stored_in_loop[loop->num];
unsigned i;
bitmap_iterator bi;
mem_ref_p ref;
*************** store_motion_loop (struct loop *loop, bi
*** 2394,2400 ****
{
vec<edge> exits = get_loop_exit_edges (loop);
struct loop *subloop;
! bitmap sm_in_loop = BITMAP_ALLOC (NULL);
if (loop_suitable_for_sm (loop, exits))
{
--- 2390,2396 ----
{
vec<edge> exits = get_loop_exit_edges (loop);
struct loop *subloop;
! bitmap sm_in_loop = BITMAP_ALLOC (&lim_bitmap_obstack);
if (loop_suitable_for_sm (loop, exits))
{
*************** static void
*** 2417,2423 ****
store_motion (void)
{
struct loop *loop;
! bitmap sm_executed = BITMAP_ALLOC (NULL);
for (loop = current_loops->tree_root->inner; loop != NULL; loop = loop->next)
store_motion_loop (loop, sm_executed);
--- 2413,2419 ----
store_motion (void)
{
struct loop *loop;
! bitmap sm_executed = BITMAP_ALLOC (&lim_bitmap_obstack);
for (loop = current_loops->tree_root->inner; loop != NULL; loop = loop->next)
store_motion_loop (loop, sm_executed);