[PATCH GCC][6/7]Support loop nest distribution for builtin partition

Richard Biener richard.guenther@gmail.com
Thu Oct 12 13:43:00 GMT 2017


On Thu, Oct 5, 2017 at 3:17 PM, Bin Cheng <Bin.Cheng@arm.com> wrote:
> Hi,
> This patch rewrites classification part of builtin partition so that nested
> builtin partitions are supported.  With this extension, below loop nest:
> void
> foo (void)
> {
>   for (unsigned i = 0; i < M; ++i)
>     for (unsigned j = 0; j < N; ++j)
>       arr[i][j] = 0;
>
> will be distributed into a single memset, rather than a loop of memset.
> Bootstrap and test in patch set on x86_64 and AArch64, is it OK?

+  tree access_size = fold_convert (sizetype, TYPE_SIZE_UNIT (TREE_TYPE (ref)));
+

TYPE_SIZE_UNIT should be always sizetype.

+  /* Classify the builtin kind.  */
+  if (single_ld == NULL)
+    classify_builtin_1 (loop, partition, single_st);
+  else
+    classify_builtin_2 (loop, rdg, partition, single_st, single_ld);

maybe name those helpers classify_builtin_st and classify_builtin_ldst?

Ok with those changes.

Thanks,
Richard.

> Thanks,
> bin
> 2017-10-04  Bin Cheng  <bin.cheng@arm.com>
>
>         * tree-loop-distribution.c (struct builtin_info): New struct.
>         (struct partition): Refactor fields into struct builtin_info.
>         (partition_free): Free struct builtin_info.
>         (build_size_arg_loc, build_addr_arg_loc): Delete.
>         (generate_memset_builtin, generate_memcpy_builtin): Get memory range
>         information from struct builtin_info.
>         (find_single_drs): New function refactored from classify_partition.
>         Also moved builtin validity checks to this function.
>         (compute_access_range, alloc_builtin): New functions.
>         (classify_builtin_1, classify_builtin_2): New functions.
>         (classify_partition): Refactor code into functions find_single_drs,
>         classify_builtin_1 and classify_builtin_2.
>         (distribute_loop): Don't do runtime alias check when distributing
>         loop nest.
>         (find_seed_stmts_for_distribution): New function.
>         (pass_loop_distribution::execute): Refactor code finding seed
>         stmts into above function.  Support distribution for the innermost
>         two-level loop nest.  Adjust dump information.
>
> gcc/testsuite/ChangeLog
> 2017-10-04  Bin Cheng  <bin.cheng@arm.com>
>
>         * gcc.dg/tree-ssa/ldist-28.c: New test.
>         * gcc.dg/tree-ssa/ldist-29.c: New test.
>         * gcc.dg/tree-ssa/ldist-30.c: New test.
>         * gcc.dg/tree-ssa/ldist-31.c: New test.



More information about the Gcc-patches mailing list