From 181f2e99d142db78be636becfe6966fdbef61cb8 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Wed, 1 Aug 2018 12:21:49 +0200 Subject: Add memmove to value profiling. 2018-08-01 Martin Liska PR value-prof/35543 * value-prof.c (interesting_stringop_to_profile_p): Simplify the code and add BUILT_IN_MEMMOVE. (gimple_stringops_transform): Likewise. 2018-08-01 Martin Liska PR value-prof/35543 * gcc.dg/tree-prof/val-prof-7.c: Add __builtin_memmove. From-SVN: r263201 --- gcc/value-prof.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'gcc/value-prof.c') diff --git a/gcc/value-prof.c b/gcc/value-prof.c index 77d4849..a7c4be7 100644 --- a/gcc/value-prof.c +++ b/gcc/value-prof.c @@ -1527,14 +1527,11 @@ interesting_stringop_to_profile_p (gcall *call, int *size_arg) enum built_in_function fcode; fcode = DECL_FUNCTION_CODE (gimple_call_fndecl (call)); - if (fcode != BUILT_IN_MEMCPY && fcode != BUILT_IN_MEMPCPY - && fcode != BUILT_IN_MEMSET && fcode != BUILT_IN_BZERO) - return false; - switch (fcode) { case BUILT_IN_MEMCPY: case BUILT_IN_MEMPCPY: + case BUILT_IN_MEMMOVE: *size_arg = 2; return validate_gimple_arglist (call, POINTER_TYPE, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE); @@ -1547,7 +1544,7 @@ interesting_stringop_to_profile_p (gcall *call, int *size_arg) return validate_gimple_arglist (call, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE); default: - gcc_unreachable (); + return false; } } @@ -1710,6 +1707,7 @@ gimple_stringops_transform (gimple_stmt_iterator *gsi) { case BUILT_IN_MEMCPY: case BUILT_IN_MEMPCPY: + case BUILT_IN_MEMMOVE: src = gimple_call_arg (stmt, 1); src_align = get_pointer_alignment (src); if (!can_move_by_pieces (val, MIN (dest_align, src_align))) -- cgit v1.1