/* Gathers memory references in loops. */
static void
-analyze_memory_references (void)
+analyze_memory_references (bool store_motion)
{
gimple_stmt_iterator bsi;
basic_block bb, *bbs;
free (bbs);
+ if (!store_motion)
+ return;
+
/* Propagate the information about accessed memory references up
the loop hierarchy. */
FOR_EACH_LOOP (loop, LI_FROM_INNERMOST)
/* Compute the global information needed by the loop invariant motion pass. */
static void
-tree_ssa_lim_initialize (void)
+tree_ssa_lim_initialize (bool store_motion)
{
class loop *loop;
unsigned i;
memory_accesses.refs_loaded_in_loop.quick_grow (number_of_loops (cfun));
memory_accesses.refs_stored_in_loop.create (number_of_loops (cfun));
memory_accesses.refs_stored_in_loop.quick_grow (number_of_loops (cfun));
- memory_accesses.all_refs_stored_in_loop.create (number_of_loops (cfun));
- memory_accesses.all_refs_stored_in_loop.quick_grow (number_of_loops (cfun));
+ if (store_motion)
+ {
+ memory_accesses.all_refs_stored_in_loop.create (number_of_loops (cfun));
+ memory_accesses.all_refs_stored_in_loop.quick_grow
+ (number_of_loops (cfun));
+ }
for (i = 0; i < number_of_loops (cfun); i++)
{
&lim_bitmap_obstack);
bitmap_initialize (&memory_accesses.refs_stored_in_loop[i],
&lim_bitmap_obstack);
- bitmap_initialize (&memory_accesses.all_refs_stored_in_loop[i],
- &lim_bitmap_obstack);
+ if (store_motion)
+ bitmap_initialize (&memory_accesses.all_refs_stored_in_loop[i],
+ &lim_bitmap_obstack);
}
memory_accesses.ttae_cache = NULL;
{
unsigned int todo = 0;
- tree_ssa_lim_initialize ();
+ tree_ssa_lim_initialize (store_motion);
/* Gathers information about memory accesses in the loops. */
- analyze_memory_references ();
+ analyze_memory_references (store_motion);
/* Fills ALWAYS_EXECUTED_IN information for basic blocks. */
fill_always_executed_in ();