The following patch finally removes the reference dependence check cache. Its benefit is too low for its cost. LIM Compile-time for PR39326 improves from 100s to 50s and LIMs memory use drops to unnoticable (from 915MB memory use after LIM to 380MB memory use after LIM).
Bootstrapped on x86_64-unknown-linux-gnu, testing in progress. Richard. 2013-03-22 Richard Biener <rguent...@suse.de> * tree-ssa-loop-im.c (struct mem_ref): Remove indep_ref and dep_ref members. (mem_ref_alloc): Do not allocate them. (refs_independent_p): Do not query or maintain a cache. Index: trunk/gcc/tree-ssa-loop-im.c =================================================================== *** trunk.orig/gcc/tree-ssa-loop-im.c 2013-03-22 12:25:13.633716049 +0100 --- trunk/gcc/tree-ssa-loop-im.c 2013-03-22 12:35:18.086448436 +0100 *************** typedef struct mem_ref *** 134,143 **** If it is only loaded, then it is independent on all stores in the loop. */ bitmap dep_loop; /* The complement of INDEP_LOOP. */ - - bitmap indep_ref; /* The set of memory references on that - this reference is independent. */ - bitmap dep_ref; /* The complement of INDEP_REF. */ } *mem_ref_p; /* We use two bits per loop in the ref->{in,}dep_loop bitmaps, the first --- 134,139 ---- *************** mem_ref_alloc (tree mem, unsigned hash, *** 1482,1489 **** ref->stored = BITMAP_ALLOC (&lim_bitmap_obstack); ref->indep_loop = BITMAP_ALLOC (&lim_bitmap_obstack); ref->dep_loop = BITMAP_ALLOC (&lim_bitmap_obstack); - ref->indep_ref = BITMAP_ALLOC (&lim_bitmap_obstack); - ref->dep_ref = BITMAP_ALLOC (&lim_bitmap_obstack); ref->accesses_in_loop.create (0); return ref; --- 1478,1483 ---- *************** refs_independent_p (mem_ref_p ref1, mem_ *** 2228,2260 **** if (ref1 == ref2) return true; - /* Reference dependence in a loop is symmetric. */ - if (ref1->id > ref2->id) - { - mem_ref_p tem = ref1; - ref1 = ref2; - ref2 = tem; - } - - if (bitmap_bit_p (ref1->indep_ref, ref2->id)) - return true; - if (bitmap_bit_p (ref1->dep_ref, ref2->id)) - return false; - if (dump_file && (dump_flags & TDF_DETAILS)) fprintf (dump_file, "Querying dependency of refs %u and %u: ", ref1->id, ref2->id); if (mem_refs_may_alias_p (ref1, ref2, &memory_accesses.ttae_cache)) { - bitmap_set_bit (ref1->dep_ref, ref2->id); if (dump_file && (dump_flags & TDF_DETAILS)) fprintf (dump_file, "dependent.\n"); return false; } else { - bitmap_set_bit (ref1->indep_ref, ref2->id); if (dump_file && (dump_flags & TDF_DETAILS)) fprintf (dump_file, "independent.\n"); return true; --- 2222,2239 ----