This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [trans-mem] memory optimization pass
- From: Richard Henderson <rth at redhat dot com>
- To: Aldy Hernandez <aldyh at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 25 Sep 2009 15:11:33 -0700
- Subject: Re: [trans-mem] memory optimization pass
- References: <20090925214556.GA27344@redhat.com>
On 09/25/2009 02:45 PM, Aldy Hernandez wrote:
The language specs for the transactional memory support provide for
hints to the runtime regarding TM memory loads and stores.
For the record, that's the runtime ABI specs not the language specs.
Patch is ok.
+ /* Put every block in the region on the worklist. */
+ for (i = 0; VEC_iterate (basic_block, blocks, i, bb); i++)
+ {
+ *qin++ = bb;
+ AVAIL_IN_WORKLIST_P (bb) = true;
+ }
...
+ /* The entry block has nothing coming in. */
+ if (bb == region->entry_block)
+ {
+ /* Do not clear AVAIL_IN_WORKLIST_P, so we never add the
+ entry block to the worklist again. */
+ bitmap_clear (STORE_AVAIL_IN (bb));
+ bitmap_clear (READ_AVAIL_IN (bb));
+ }
It occurred to me that we could avoid putting the entry block
into the worklist in the first place:
AVAIL_IN_WORKLIST_P (region->entry_block) = 1;
for (i = 1; ...)
+ struct tm_memopt_bitmaps *b = XCNEWVEC (struct tm_memopt_bitmaps, 1);
+ b->store_avail_in = BITMAP_ALLOC (NULL);
+ b->store_avail_out = BITMAP_ALLOC (NULL);
+ b->store_antic_in = BITMAP_ALLOC (NULL);
+ b->store_avail_out = BITMAP_ALLOC (NULL);
+ b->read_avail_in = BITMAP_ALLOC (NULL);
+ b->read_avail_out = BITMAP_ALLOC (NULL);
+ b->read_local = BITMAP_ALLOC (NULL);
+ b->store_local = BITMAP_ALLOC (NULL);
+ return b;
I do suggest allocating all of these off of an obstack.
r~