diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-05-28 18:03:56 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-05-28 18:03:56 +0000 |
commit | 421e19dde5ca91eb54aee9f8d15546a7c37c84a9 (patch) | |
tree | dd229dc2bdb52fc7314fe74408a642d2f50015b1 /gcc/testsuite | |
parent | bb3d0c3095a1485769ed129a6167f185afb64bee (diff) | |
download | gcc-421e19dde5ca91eb54aee9f8d15546a7c37c84a9.tar.gz |
* tree-ssa-threadupdate.c: (create_edge_and_update_destination_phis):
Update profile.
* value-prof.c (tree_divmod_fixed_value_transform): Be more verbose in
debug output.
(tree_mod_subtract): Fix profile updating code.
(tree_divmod_values_to_profile): Do not produce useless value profilers
for divisions.
* tree-prof.exp: Fix comment.
* value-prof-1.c: New.
* value-prof-2.c: New.
* value-prof-3.c: New.
* value-prof-4.c: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100298 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-prof/tree-prof.exp | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-prof/val-prof-1.c | 20 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-prof/val-prof-2.c | 30 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-prof/val-prof-3.c | 30 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-prof/val-prof-4.c | 30 |
6 files changed, 119 insertions, 1 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a6d54b3a4fc..0416c70aed4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2005-05-28 Jan Hubicka <jh@suse.cz> + + * tree-prof.exp: Fix comment. + * value-prof-1.c: New. + * value-prof-2.c: New. + * value-prof-3.c: New. + * value-prof-4.c: New. + 2005-05-27 Mark Mitchell <mark@codesourcery.com> PR c++/21614 diff --git a/gcc/testsuite/gcc.dg/tree-prof/tree-prof.exp b/gcc/testsuite/gcc.dg/tree-prof/tree-prof.exp index 307cc2c52ae..9559a80e187 100644 --- a/gcc/testsuite/gcc.dg/tree-prof/tree-prof.exp +++ b/gcc/testsuite/gcc.dg/tree-prof/tree-prof.exp @@ -15,7 +15,7 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Test the functionality of programs compiled with profile-directed block -# ordering using -fprofile-generate followed by -fprofile-use +# ordering using -fprofile-generate followed by -fbranch-use. load_lib target-supports.exp diff --git a/gcc/testsuite/gcc.dg/tree-prof/val-prof-1.c b/gcc/testsuite/gcc.dg/tree-prof/val-prof-1.c new file mode 100644 index 00000000000..db3bc950f5a --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-prof/val-prof-1.c @@ -0,0 +1,20 @@ +/* { dg-options "-O2 -fdump-tree-optimized -fdump-tree-tree_profile" } */ +int a[1000]; +int b = 256; +int c = 257; +main () +{ + int i; + int n; + for (i = 0; i < 1000; i++) + { + if (i % 17) + n = c; + else n = b; + a[i] /= n; + } + return 0; +} +/* { dg-final-use { scan-tree-dump "Div.mod by constant n=257 transformation on insn" "tree_profile"} } */ +/* { dg-final-use { scan-tree-dump "if \\(n != 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 new file mode 100644 index 00000000000..c11f7ea20e4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-prof/val-prof-2.c @@ -0,0 +1,30 @@ +/* { dg-options "-O2 -fdump-tree-optimized -fdump-tree-tree_profile" } */ +unsigned int a[1000]; +unsigned int b = 256; +unsigned int c = 1024; +unsigned int d = 17; +main () +{ + int i; + unsigned int n; + for (i = 0; i < 1000; i++) + { + a[i]=100*i; + } + for (i = 0; i < 1000; i++) + { + if (i % 2) + n = b; + else if (i % 3) + n = c; + else + n = d; + a[i] %= n; + } + return 0; +} +/* { dg-final-use { scan-tree-dump "Mod power of 2 transformation on insn" "tree_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 { scan-tree-dump "n \\+ \\-1" "optimized"} } */ +/* { dg-final-use { scan-tree-dump-not "Invalid sum" "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 new file mode 100644 index 00000000000..91ebd376177 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-prof/val-prof-3.c @@ -0,0 +1,30 @@ +/* { dg-options "-O2 -fdump-tree-optimized -fdump-tree-tree_profile" } */ +unsigned int a[1000]; +unsigned int b = 257; +unsigned int c = 1023; +unsigned int d = 19; +main () +{ + int i; + unsigned int n; + for (i = 0; i < 1000; i++) + { + a[i]=18; + } + for (i = 0; i < 1000; i++) + { + if (i % 2) + n = b; + else if (i % 3) + n = c; + else + n = d; + a[i] %= n; + } + return 0; +} +/* { dg-final-use { scan-tree-dump "Mod subtract transformation on insn" "tree_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 { scan-tree-dump "if \\(n \\>" "optimized"} } */ +/* { dg-final-use { scan-tree-dump-not "Invalid sum" "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 new file mode 100644 index 00000000000..4fff1123beb --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-prof/val-prof-4.c @@ -0,0 +1,30 @@ +/* { dg-options "-O2 -fdump-tree-optimized -fdump-tree-tree_profile" } */ +unsigned int a[1000]; +unsigned int b = 999; +unsigned int c = 1002; +unsigned int d = 1003; +main () +{ + int i; + unsigned int n; + for (i = 0; i < 1000; i++) + { + a[i]=1000+i; + } + for (i = 0; i < 1000; i++) + { + if (i % 2) + n = b; + else if (i % 3) + n = c; + else + n = d; + a[i] %= n; + } + return 0; +} +/* { dg-final-use { scan-tree-dump "Mod subtract transformation on insn" "tree_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 { scan-tree-dump "if \\(n \\>" "optimized"} } */ +/* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */ |