aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-loop-distribution.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-loop-distribution.c')
-rw-r--r--gcc/tree-loop-distribution.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c
index 902cf30..aabc11a 100644
--- a/gcc/tree-loop-distribution.c
+++ b/gcc/tree-loop-distribution.c
@@ -466,7 +466,7 @@ build_rdg (vec<loop_p> loop_nest, control_dependences *cd)
enum partition_kind {
- PKIND_NORMAL, PKIND_MEMSET, PKIND_MEMCPY
+ PKIND_NORMAL, PKIND_MEMSET, PKIND_MEMCPY, PKIND_MEMMOVE
};
struct partition
@@ -875,10 +875,11 @@ generate_memcpy_builtin (struct loop *loop, partition *partition)
false, GSI_CONTINUE_LINKING);
dest = build_addr_arg_loc (loc, partition->main_dr, nb_bytes);
src = build_addr_arg_loc (loc, partition->secondary_dr, nb_bytes);
- if (ptr_derefs_may_alias_p (dest, src))
- kind = BUILT_IN_MEMMOVE;
- else
+ if (partition->kind == PKIND_MEMCPY
+ || ! ptr_derefs_may_alias_p (dest, src))
kind = BUILT_IN_MEMCPY;
+ else
+ kind = BUILT_IN_MEMMOVE;
dest = force_gimple_operand_gsi (&gsi, dest, true, NULL_TREE,
false, GSI_CONTINUE_LINKING);
@@ -970,6 +971,7 @@ generate_code_for_partition (struct loop *loop,
break;
case PKIND_MEMCPY:
+ case PKIND_MEMMOVE:
generate_memcpy_builtin (loop, partition);
break;
@@ -1166,10 +1168,12 @@ classify_partition (loop_p loop, struct graph *rdg, partition *partition)
return;
}
}
+ partition->kind = PKIND_MEMMOVE;
}
+ else
+ partition->kind = PKIND_MEMCPY;
free_dependence_relation (ddr);
loops.release ();
- partition->kind = PKIND_MEMCPY;
partition->main_dr = single_store;
partition->secondary_dr = single_load;
partition->niter = nb_iter;