This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH GCC][07/13]Preserve data references for whole distribution life time


On Mon, Jun 12, 2017 at 7:02 PM, Bin Cheng <Bin.Cheng@arm.com> wrote:
> Hi,
> This patch collects and preserves all data references in loop for whole
> distribution life time.  It will be used afterwards.
>
> Bootstrap and test on x86_64 and AArch64.  Is it OK?

+/* Vector of data references in the loop to be distributed.  */
+static vec<data_reference_p> *datarefs_vec;
+
+/* Map of data reference in the loop to a unique id.  */
+static hash_map<data_reference_p, int> *datarefs_map;
+

no need to make those pointers.  It's not a unique id but
the index into the datarefs_vec vector, right?

loop distribution doesn't yet use dr->aux so it would be nice
to avoid the hash_map in favor of using that field.

#define DR_INDEX (dr) ((uintptr_t)(dr)->aux)

+  if (datarefs_vec->length () > 64)

There is PARAM_VALUE (PARAM_LOOP_MAX_DATAREFS_FOR_DATADEPS)
with a default value of 1000.  Please use that instead of magic numbers.

+    {
+      if (dump_file && (dump_flags & TDF_DETAILS))
+       fprintf (dump_file,
+                "Loop %d not distributed: more than 64 memory references.\n",
+                loop->num);
+
+      free_rdg (rdg);
+      loop_nest->release ();
+      delete loop_nest;
+      free_data_refs (*datarefs_vec);
+      delete datarefs_vec;
+      return 0;
+    }

auto_* were so nice ...

> Thanks,
> bin
> 2017-06-07  Bin Cheng  <bin.cheng@arm.com>
>
>         * tree-loop-distribution.c (datarefs_vec, datarefs_map): New
>         global var.
>         (create_rdg_vertices): Use datarefs_vec directly.
>         (free_rdg): Don't free data references.
>         (build_rdg): Update use.  Don't free data references.
>         (distribute_loop): Compute global variable for data references.
>         Bail out if there are too many data references.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]