Commit 939cf90f by Bin Cheng Committed by Bin Cheng

tree-loop-distribution.c (struct builtin_info): New struct.

	* 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_st, classify_builtin_ldst): New functions.
	(classify_partition): Refactor code into functions find_single_drs,
	classify_builtin_st and classify_builtin_ldst.
	(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
	* 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.

From-SVN: r253680
parent 163aa51b
2017-10-12 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_st, classify_builtin_ldst): New functions.
(classify_partition): Refactor code into functions find_single_drs,
classify_builtin_st and classify_builtin_ldst.
(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.
2017-10-12 Bin Cheng <bin.cheng@arm.com>
* tree-loop-distribution.c: Adjust the general comment.
(NUM_PARTITION_THRESHOLD): New macro.
(ssa_name_has_uses_outside_loop_p): Support loop nest distribution.
2017-10-12 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.
2017-10-12 Bin Cheng <bin.cheng@arm.com>
* gcc.dg/tree-ssa/ldist-7.c: Adjust test string.
* gcc.dg/tree-ssa/ldist-16.c: Ditto.
* gcc.dg/tree-ssa/ldist-25.c: Ditto.
......
/* { dg-do compile } */
/* { dg-options "-O2 -ftree-loop-distribution -ftree-loop-distribute-patterns -fdump-tree-ldist-details" } */
#define M (256)
#define N (1024)
int arr[M][N];
void
foo (void)
{
for (unsigned i = 0; i < M; ++i)
for (unsigned j = 0; j < N; ++j)
arr[i][j] = 0;
}
/* { dg-final { scan-tree-dump "Loop nest . distributed: split to 0 loops and 1 library" "ldist" } } */
/* { dg-do compile } */
/* { dg-options "-O2 -ftree-loop-distribution -ftree-loop-distribute-patterns -fdump-tree-ldist-details" } */
#define M (256)
#define N (512)
int arr[M][N];
void
foo (void)
{
for (unsigned i = 0; i < M; ++i)
for (unsigned j = 0; j < N - 1; ++j)
arr[i][j] = 0;
}
/* { dg-final { scan-tree-dump-not "Loop nest . distributed: split to" "ldist" } } */
/* { dg-final { scan-tree-dump-times "Loop . distributed: split to 0 loops and 1 library" 1 "ldist" } } */
/* { dg-do compile } */
/* { dg-options "-O2 -ftree-loop-distribution -ftree-loop-distribute-patterns -fdump-tree-ldist-details" } */
#define M (256)
#define N (512)
int a[M][N], b[M][N];
void
foo (void)
{
for (unsigned i = 0; i < M; ++i)
for (unsigned j = N; j > 0; --j)
a[i][j - 1] = b[i][j - 1];
}
/* { dg-final { scan-tree-dump-times "Loop nest . distributed: split to" 1 "ldist" } } */
/* { dg-do compile } */
/* { dg-options "-O2 -ftree-loop-distribution -ftree-loop-distribute-patterns -fdump-tree-ldist-details" } */
#define M (256)
#define N (512)
int a[M][N], b[M][N], c[M];
void
foo (void)
{
for (int i = M - 1; i >= 0; --i)
{
c[i] = 0;
for (unsigned j = N; j > 0; --j)
a[i][j - 1] = b[i][j - 1];
}
}
/* { dg-final { scan-tree-dump-times "Loop nest . distributed: split to 0 loops and 2 library" 1 "ldist" } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment