diff options
author | Martin Liska <mliska@suse.cz> | 2018-08-01 12:50:48 +0200 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2018-08-01 10:50:48 +0000 |
commit | 7f87c8dae2a7d4447bef7686c92d8e896edabe6a (patch) | |
tree | cc5fb4141889a6ceb5fa7b8af4eaaec20479e536 /gcc | |
parent | fd2e1dcd253d34aeca751518970c20cc3e9a8716 (diff) | |
download | gcc-7f87c8dae2a7d4447bef7686c92d8e896edabe6a.zip gcc-7f87c8dae2a7d4447bef7686c92d8e896edabe6a.tar.gz gcc-7f87c8dae2a7d4447bef7686c92d8e896edabe6a.tar.bz2 |
Improve dumping of value profiling transformations.
2018-08-01 Martin Liska <mliska@suse.cz>
* value-prof.c (gimple_divmod_fixed_value_transform): Unify
format how successful transformation is dumped.
(gimple_mod_pow2_value_transform): Likewise.
(gimple_mod_subtract_transform): Likewise.
(gimple_stringops_transform): Likewise.
2018-08-01 Martin Liska <mliska@suse.cz>
* gcc.dg/tree-prof/stringop-1.c: Adjust scanned pattern.
* gcc.dg/tree-prof/stringop-2.c: Likewise.
* gcc.dg/tree-prof/val-prof-1.c: Likewise.
* gcc.dg/tree-prof/val-prof-2.c: Likewise.
* gcc.dg/tree-prof/val-prof-3.c: Likewise.
* gcc.dg/tree-prof/val-prof-4.c: Likewise.
* gcc.dg/tree-prof/val-prof-5.c: Likewise.
* gcc.dg/tree-prof/val-prof-7.c: Likewise.
From-SVN: r263203
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 11 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-prof/stringop-1.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-prof/stringop-2.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-prof/val-prof-1.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-prof/val-prof-2.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-prof/val-prof-3.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-prof/val-prof-4.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-prof/val-prof-5.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-prof/val-prof-7.c | 24 | ||||
-rw-r--r-- | gcc/value-prof.c | 29 |
11 files changed, 47 insertions, 39 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a4cb451..477b245 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,13 @@ 2018-08-01 Martin Liska <mliska@suse.cz> + * value-prof.c (gimple_divmod_fixed_value_transform): Unify + format how successful transformation is dumped. + (gimple_mod_pow2_value_transform): Likewise. + (gimple_mod_subtract_transform): Likewise. + (gimple_stringops_transform): Likewise. + +2018-08-01 Martin Liska <mliska@suse.cz> + PR value-prof/35543 * value-prof.c (interesting_stringop_to_profile_p): Simplify the code and add BUILT_IN_MEMMOVE. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 00af769..a6c2a7f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,16 @@ 2018-08-01 Martin Liska <mliska@suse.cz> + * gcc.dg/tree-prof/stringop-1.c: Adjust scanned pattern. + * gcc.dg/tree-prof/stringop-2.c: Likewise. + * gcc.dg/tree-prof/val-prof-1.c: Likewise. + * gcc.dg/tree-prof/val-prof-2.c: Likewise. + * gcc.dg/tree-prof/val-prof-3.c: Likewise. + * gcc.dg/tree-prof/val-prof-4.c: Likewise. + * gcc.dg/tree-prof/val-prof-5.c: Likewise. + * gcc.dg/tree-prof/val-prof-7.c: Likewise. + +2018-08-01 Martin Liska <mliska@suse.cz> + PR value-prof/35543 * gcc.dg/tree-prof/val-prof-7.c: Add __builtin_memmove. diff --git a/gcc/testsuite/gcc.dg/tree-prof/stringop-1.c b/gcc/testsuite/gcc.dg/tree-prof/stringop-1.c index 6f8908a..d75b254 100644 --- a/gcc/testsuite/gcc.dg/tree-prof/stringop-1.c +++ b/gcc/testsuite/gcc.dg/tree-prof/stringop-1.c @@ -15,7 +15,7 @@ main() return 0; } /* autofdo doesn't support value profiling for now: */ -/* { dg-final-use-not-autofdo { scan-ipa-dump "Single value 4 stringop" "profile"} } */ +/* { dg-final-use-not-autofdo { scan-ipa-dump "Transformation done: single value 4 stringop" "profile"} } */ /* Really this ought to simplify into assignment, but we are not there yet. */ /* a[0] = b[0] is what we fold the resulting memcpy into. */ /* { dg-final-use-not-autofdo { scan-tree-dump " = MEM.*&b" "optimized"} } */ diff --git a/gcc/testsuite/gcc.dg/tree-prof/stringop-2.c b/gcc/testsuite/gcc.dg/tree-prof/stringop-2.c index 330b159..3242cf5 100644 --- a/gcc/testsuite/gcc.dg/tree-prof/stringop-2.c +++ b/gcc/testsuite/gcc.dg/tree-prof/stringop-2.c @@ -20,6 +20,6 @@ main() return 0; } /* autofdo doesn't support value profiling for now: */ -/* { dg-final-use-not-autofdo { scan-ipa-dump "Single value 4 stringop" "profile"} } */ +/* { dg-final-use-not-autofdo { scan-ipa-dump "Transformation done: single value 4 stringop" "profile"} } */ /* The versioned memset of size 4 should be optimized to an assignment. */ /* { dg-final-use-not-autofdo { scan-tree-dump "MEM\\\[\\(void .\\)&a\\\] = 168430090" "optimized"} } */ diff --git a/gcc/testsuite/gcc.dg/tree-prof/val-prof-1.c b/gcc/testsuite/gcc.dg/tree-prof/val-prof-1.c index 35e0f90..492c4c1 100644 --- a/gcc/testsuite/gcc.dg/tree-prof/val-prof-1.c +++ b/gcc/testsuite/gcc.dg/tree-prof/val-prof-1.c @@ -17,6 +17,6 @@ main () return 0; } /* autofdo does not do value profiling so far */ -/* { dg-final-use-not-autofdo { scan-ipa-dump "Div.mod by constant n_\[0-9\]*=257 transformation on insn" "profile"} } */ +/* { dg-final-use-not-autofdo { scan-ipa-dump "Transformation done: div.mod by constant 257" "profile"} } */ /* { dg-final-use-not-autofdo { scan-tree-dump "if \\(n_\[0-9\]* != 257\\)" "optimized"} } */ /* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */ diff --git a/gcc/testsuite/gcc.dg/tree-prof/val-prof-2.c b/gcc/testsuite/gcc.dg/tree-prof/val-prof-2.c index ad78043..8cb3c64 100644 --- a/gcc/testsuite/gcc.dg/tree-prof/val-prof-2.c +++ b/gcc/testsuite/gcc.dg/tree-prof/val-prof-2.c @@ -25,7 +25,7 @@ main () return 0; } /* autofdo does not do value profiling so far */ -/* { dg-final-use-not-autofdo { scan-ipa-dump "Mod power of 2 transformation on insn" "profile" } } */ +/* { dg-final-use-not-autofdo { scan-ipa-dump "Transformation done: mod power of 2" "profile" } } */ /* This is part of code checking that n is power of 2, so we are sure that the transformation didn't get optimized out. */ /* { dg-final-use-not-autofdo { scan-tree-dump "n_\[0-9\]* \\+ (4294967295|0x0*ffffffff)" "optimized"} } */ diff --git a/gcc/testsuite/gcc.dg/tree-prof/val-prof-3.c b/gcc/testsuite/gcc.dg/tree-prof/val-prof-3.c index 366ada1..60953d0 100644 --- a/gcc/testsuite/gcc.dg/tree-prof/val-prof-3.c +++ b/gcc/testsuite/gcc.dg/tree-prof/val-prof-3.c @@ -25,7 +25,7 @@ main () return 0; } /* autofdo does not do value profiling so far */ -/* { dg-final-use-not-autofdo { scan-ipa-dump "Mod subtract transformation on insn" "profile" } } */ +/* { dg-final-use-not-autofdo { scan-ipa-dump "Transformation done: mod subtract" "profile" } } */ /* This is part of code checking that n is greater than the divisor so we are sure that it didn't get optimized out. */ /* { dg-final-use-not-autofdo { scan-tree-dump "if \\(_\[0-9\]* \\< n_\[0-9\]*" "optimized"} } */ diff --git a/gcc/testsuite/gcc.dg/tree-prof/val-prof-4.c b/gcc/testsuite/gcc.dg/tree-prof/val-prof-4.c index 374428e..50ae2de 100644 --- a/gcc/testsuite/gcc.dg/tree-prof/val-prof-4.c +++ b/gcc/testsuite/gcc.dg/tree-prof/val-prof-4.c @@ -25,7 +25,7 @@ main () return 0; } /* autofdo does not do value profiling so far */ -/* { dg-final-use-not-autofdo { scan-ipa-dump "Mod subtract transformation on insn" "profile" } } */ +/* { dg-final-use-not-autofdo { scan-ipa-dump "Transformation done: mod subtract" "profile" } } */ /* This is part of code checking that n is greater than the divisor so we are sure that it didn't get optimized out. */ /* { dg-final-use-not-autofdo { scan-tree-dump "if \\(n_\[0-9\]* \\>" "optimized"} } */ diff --git a/gcc/testsuite/gcc.dg/tree-prof/val-prof-5.c b/gcc/testsuite/gcc.dg/tree-prof/val-prof-5.c index 7f4a15b..80eb320 100644 --- a/gcc/testsuite/gcc.dg/tree-prof/val-prof-5.c +++ b/gcc/testsuite/gcc.dg/tree-prof/val-prof-5.c @@ -13,5 +13,5 @@ main() return 0; } /* autofdo does not do value profiling so far */ -/* { dg-final-use-not-autofdo { scan-ipa-dump "Div.mod by constant b.*=997 transformation on insn" "profile" } } */ +/* { dg-final-use-not-autofdo { scan-ipa-dump "Transformation done: div.mod by constant 997" "profile" } } */ /* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */ diff --git a/gcc/testsuite/gcc.dg/tree-prof/val-prof-7.c b/gcc/testsuite/gcc.dg/tree-prof/val-prof-7.c index bb9dd21..18b2b25 100644 --- a/gcc/testsuite/gcc.dg/tree-prof/val-prof-7.c +++ b/gcc/testsuite/gcc.dg/tree-prof/val-prof-7.c @@ -65,18 +65,18 @@ int main() { return 0; } -/* { dg-final-use-not-autofdo { scan-ipa-dump "Single value 8 stringop transformation on __builtin_memcpy" "profile" } } */ -/* { dg-final-use-not-autofdo { scan-ipa-dump "Single value 55 stringop transformation on __builtin_memcpy" "profile" } } */ -/* { dg-final-use-not-autofdo { scan-ipa-dump-times "Single value 32 stringop transformation on __builtin_memcpy" 0 "profile" } } */ +/* { dg-final-use-not-autofdo { scan-ipa-dump "Transformation done: single value 8 stringop for BUILT_IN_MEMCPY" "profile" } } */ +/* { dg-final-use-not-autofdo { scan-ipa-dump "Transformation done: single value 55 stringop for BUILT_IN_MEMCPY" "profile" } } */ +/* { dg-final-use-not-autofdo { scan-ipa-dump-times "Transformation done: single value 32 stringop for BUILT_IN_MEMCPY" 0 "profile" } } */ -/* { dg-final-use-not-autofdo { scan-ipa-dump "Single value 8 stringop transformation on __builtin_mempcpy" "profile" } } */ -/* { dg-final-use-not-autofdo { scan-ipa-dump "Single value 55 stringop transformation on __builtin_mempcpy" "profile" } } */ -/* { dg-final-use-not-autofdo { scan-ipa-dump-times "Single value 32 stringop transformation on __builtin_mempcpy" 0 "profile" } } */ +/* { dg-final-use-not-autofdo { scan-ipa-dump "Transformation done: single value 8 stringop for BUILT_IN_MEMPCPY" "profile" } } */ +/* { dg-final-use-not-autofdo { scan-ipa-dump "Transformation done: single value 55 stringop for BUILT_IN_MEMPCPY" "profile" } } */ +/* { dg-final-use-not-autofdo { scan-ipa-dump-times "Transformation done: single value 32 stringop for BUILT_IN_MEMPCPY" 0 "profile" } } */ -/* { dg-final-use-not-autofdo { scan-ipa-dump "Single value 8 stringop transformation on __builtin_memset" "profile" } } */ -/* { dg-final-use-not-autofdo { scan-ipa-dump "Single value 55 stringop transformation on __builtin_memset" "profile" } } */ -/* { dg-final-use-not-autofdo { scan-ipa-dump-times "Single value 32 stringop transformation on __builtin_memset" 0 "profile" } } */ +/* { dg-final-use-not-autofdo { scan-ipa-dump "Transformation done: single value 8 stringop for BUILT_IN_MEMSET" "profile" } } */ +/* { dg-final-use-not-autofdo { scan-ipa-dump "Transformation done: single value 55 stringop for BUILT_IN_MEMSET" "profile" } } */ +/* { dg-final-use-not-autofdo { scan-ipa-dump-times "Transformation done: single value 32 stringop for BUILT_IN_MEMSET" 0 "profile" } } */ -/* { dg-final-use-not-autofdo { scan-ipa-dump "Single value 8 stringop transformation on __builtin_memmove" "profile" } } */ -/* { dg-final-use-not-autofdo { scan-ipa-dump "Single value 55 stringop transformation on __builtin_memmove" "profile" } } */ -/* { dg-final-use-not-autofdo { scan-ipa-dump-times "Single value 32 stringop transformation on __builtin_memmove" 0 "profile" } } */ +/* { dg-final-use-not-autofdo { scan-ipa-dump "Transformation done: single value 8 stringop for BUILT_IN_MEMMOVE" "profile" } } */ +/* { dg-final-use-not-autofdo { scan-ipa-dump "Transformation done: single value 55 stringop for BUILT_IN_MEMMOVE" "profile" } } */ +/* { dg-final-use-not-autofdo { scan-ipa-dump-times "Transformation done: single value 32 stringop for BUILT_IN_MEMMOVE" 0 "profile" } } */ diff --git a/gcc/value-prof.c b/gcc/value-prof.c index a7c4be7..29489e0 100644 --- a/gcc/value-prof.c +++ b/gcc/value-prof.c @@ -821,12 +821,9 @@ gimple_divmod_fixed_value_transform (gimple_stmt_iterator *si) if (dump_file) { - fprintf (dump_file, "Div/mod by constant "); - print_generic_expr (dump_file, value, TDF_SLIM); - fprintf (dump_file, "="); + fprintf (dump_file, "Transformation done: div/mod by constant "); print_generic_expr (dump_file, tree_val, TDF_SLIM); - fprintf (dump_file, " transformation on insn "); - print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM); + fprintf (dump_file, "\n"); } gimple_assign_set_rhs_from_tree (si, result); @@ -956,18 +953,15 @@ gimple_mod_pow2_value_transform (gimple_stmt_iterator *si) || optimize_bb_for_size_p (gimple_bb (stmt))) return false; - if (dump_file) - { - fprintf (dump_file, "Mod power of 2 transformation on insn "); - print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM); - } - /* Compute probability of taking the optimal path. */ all = count + wrong_values; if (check_counter (stmt, "pow2", &count, &all, gimple_bb (stmt)->count)) return false; + if (dump_file) + fprintf (dump_file, "Transformation done: mod power of 2\n"); + if (all > 0) prob = profile_probability::probability_in_gcov_type (count, all); else @@ -1151,10 +1145,7 @@ gimple_mod_subtract_transform (gimple_stmt_iterator *si) gimple_remove_histogram_value (cfun, stmt, histogram); if (dump_file) - { - fprintf (dump_file, "Mod subtract transformation on insn "); - print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM); - } + fprintf (dump_file, "Transformation done: mod subtract\n"); /* Compute probability of taking the optimal path(s). */ if (all > 0) @@ -1742,11 +1733,9 @@ gimple_stringops_transform (gimple_stmt_iterator *gsi) } if (dump_file) - { - fprintf (dump_file, "Single value %i stringop transformation on ", - (int)val); - print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM); - } + fprintf (dump_file, + "Transformation done: single value %i stringop for %s\n", + (int)val, built_in_names[(int)fcode]); gimple_stringop_fixed_value (stmt, tree_val, prob, count, all); |