diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4d154702361c9382d6a818254edffb3344b3fe4e..77f56a5f64452b199f5523432aaaa857c9c1debf 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -136,15 +136,15 @@ 2012-05-08 Dehao Chen <dehao@google.com> - * predict.c (find_qualified_ssa_name): New - (find_ssa_name_in_expr): New - (find_ssa_name_in_assign_stmt): New - (is_comparison_with_loop_invariant_p): New - (is_bound_expr_similar): New - (predict_iv_comparison): New + * predict.c (find_qualified_ssa_name): New. + (find_ssa_name_in_expr): New. + (find_ssa_name_in_assign_stmt): New. + (is_comparison_with_loop_invariant_p): New. + (is_bound_expr_similar): New. + (predict_iv_comparison): New. (predict_loops): Add heuristic for loop-nested branches that compare an induction variable to a loop bound variable. - * predict.def (PRED_LOOP_IV_COMPARE): New macro + * predict.def (PRED_LOOP_IV_COMPARE): New macro. 2012-05-08 Uros Bizjak <ubizjak@gmail.com> diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 88e4cc887a0cd9e4740f994244e17cda1dcf171f..5a09dc1d6eea14b61501c850cc2f3b11a0c60e6e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2012-05-09 Dehao Chen <dehao@google.com> + + * gcc.dg/predict-1.c: Remove the replicated text in this test. + * gcc.dg/predict-2.c: Likewise. + * gcc.dg/predict-3.c: Likewise. + * gcc.dg/predict-4.c: Likewise. + * gcc.dg/predict-5.c: Likewise. + * gcc.dg/predict-6.c: Likewise. + 2012-05-08 Hans-Peter Nilsson <hp@axis.com> PR target/53272 diff --git a/gcc/testsuite/gcc.dg/predict-1.c b/gcc/testsuite/gcc.dg/predict-1.c index e7f4618a0f7beb1213dcd0c779b47bd1caac2cd3..5c9a5a930a5655b3384e126df358cec07081b690 100644 --- a/gcc/testsuite/gcc.dg/predict-1.c +++ b/gcc/testsuite/gcc.dg/predict-1.c @@ -25,30 +25,3 @@ void foo (int bound) /* { dg-final { scan-tree-dump-times "loop iv compare heuristics: 0.0%" 5 "profile_estimate"} } */ /* { dg-final { cleanup-tree-dump "profile_estimate" } } */ -/* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-profile_estimate" } */ - -extern int global; - -int bar(int); - -void foo (int bound) -{ - int i, ret = 0; - for (i = 0; i < bound; i++) - { - if (i > bound) - global += bar (i); - if (i >= bound + 2) - global += bar (i); - if (i > bound - 2) - global += bar (i); - if (i + 2 > bound) - global += bar (i); - if (i == 10) - global += bar (i); - } -} - -/* { dg-final { scan-tree-dump-times "loop iv compare heuristics: 0.0%" 5 "profile_estimate"} } */ -/* { dg-final { cleanup-tree-dump "profile_estimate" } } */ diff --git a/gcc/testsuite/gcc.dg/predict-2.c b/gcc/testsuite/gcc.dg/predict-2.c index 44895b7cf642969c51a104e1228629001e8a4b78..55ca1d0bc7eb538031f9e888695ebeea7f81b6b2 100644 --- a/gcc/testsuite/gcc.dg/predict-2.c +++ b/gcc/testsuite/gcc.dg/predict-2.c @@ -25,30 +25,3 @@ void foo (int base, int bound) /* { dg-final { scan-tree-dump-not "loop iv compare heuristics" "profile_estimate"} } */ /* { dg-final { cleanup-tree-dump "profile_estimate" } } */ -/* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-profile_estimate" } */ - -extern int global; - -int bar(int); - -void foo (int base, int bound) -{ - int i, ret = 0; - for (i = base; i < bound; i++) - { - if (i > bound * bound) - global += bar (i); - if (i > bound + 10) - global += bar (i); - if (i <= bound + 10) - global += bar (i); - if (i > base + 10) - global += bar (i); - if (i < base - 10) - global += bar (i); - } -} - -/* { dg-final { scan-tree-dump-not "loop iv compare heuristics" "profile_estimate"} } */ -/* { dg-final { cleanup-tree-dump "profile_estimate" } } */ diff --git a/gcc/testsuite/gcc.dg/predict-3.c b/gcc/testsuite/gcc.dg/predict-3.c index afaf5400ffe53f66d2b569a4825a62ecee7718fc..8881bde30b6f2866e6bad9df05bbc463f887f9b6 100644 --- a/gcc/testsuite/gcc.dg/predict-3.c +++ b/gcc/testsuite/gcc.dg/predict-3.c @@ -23,28 +23,3 @@ void foo (int bound) /* { dg-final { scan-tree-dump-times "loop iv compare heuristics: 100.0%" 4 "profile_estimate"} } */ /* { dg-final { cleanup-tree-dump "profile_estimate" } } */ -/* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-profile_estimate" } */ - -extern int global; - -int bar(int); - -void foo (int bound) -{ - int i, ret = 0; - for (i = 0; i <= bound; i++) - { - if (i < bound - 2) - global += bar (i); - if (i <= bound) - global += bar (i); - if (i + 1 < bound) - global += bar (i); - if (i != bound) - global += bar (i); - } -} - -/* { dg-final { scan-tree-dump-times "loop iv compare heuristics: 100.0%" 4 "profile_estimate"} } */ -/* { dg-final { cleanup-tree-dump "profile_estimate" } } */ diff --git a/gcc/testsuite/gcc.dg/predict-4.c b/gcc/testsuite/gcc.dg/predict-4.c index f575b98de5f9952486f86ae0e0d332591b517098..17a50b9ead515c1abe6ae10b941a1e4db7cfc9c8 100644 --- a/gcc/testsuite/gcc.dg/predict-4.c +++ b/gcc/testsuite/gcc.dg/predict-4.c @@ -17,22 +17,3 @@ void foo (int bound) /* { dg-final { scan-tree-dump "loop iv compare heuristics: 50.0%" "profile_estimate"} } */ /* { dg-final { cleanup-tree-dump "profile_estimate" } } */ -/* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-profile_estimate" } */ - -extern int global; - -int bar(int); - -void foo (int bound) -{ - int i, ret = 0; - for (i = 0; i < 10; i++) - { - if (i < 5) - global += bar (i); - } -} - -/* { dg-final { scan-tree-dump "loop iv compare heuristics: 50.0%" "profile_estimate"} } */ -/* { dg-final { cleanup-tree-dump "profile_estimate" } } */ diff --git a/gcc/testsuite/gcc.dg/predict-5.c b/gcc/testsuite/gcc.dg/predict-5.c index f6e70d3254008814832fa8f15619458830e9aced..f2fe339b6cbc8a7883307f16160e4668df5c1a6d 100644 --- a/gcc/testsuite/gcc.dg/predict-5.c +++ b/gcc/testsuite/gcc.dg/predict-5.c @@ -23,28 +23,3 @@ void foo (int base, int bound) /* { dg-final { scan-tree-dump-times "loop iv compare heuristics: 100.0%" 4 "profile_estimate"} } */ /* { dg-final { cleanup-tree-dump "profile_estimate" } } */ -/* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-profile_estimate" } */ - -extern int global; - -int bar (int); - -void foo (int base, int bound) -{ - int i, ret = 0; - for (i = base; i <= bound; i++) - { - if (i > base) - global += bar (i); - if (i > base + 1) - global += bar (i); - if (i >= base + 3) - global += bar (i); - if (i - 2 >= base) - global += bar (i); - } -} - -/* { dg-final { scan-tree-dump-times "loop iv compare heuristics: 100.0%" 4 "profile_estimate"} } */ -/* { dg-final { cleanup-tree-dump "profile_estimate" } } */ diff --git a/gcc/testsuite/gcc.dg/predict-6.c b/gcc/testsuite/gcc.dg/predict-6.c index 552fd0743f3b0c1a7846063f40328261faf74982..bf769fd2cf8e65a3d70134ba110deab6ee092cd5 100644 --- a/gcc/testsuite/gcc.dg/predict-6.c +++ b/gcc/testsuite/gcc.dg/predict-6.c @@ -23,28 +23,3 @@ void foo (int base, int bound) /* { dg-final { scan-tree-dump-times "loop iv compare heuristics: 0.0%" 4 "profile_estimate"} } */ /* { dg-final { cleanup-tree-dump "profile_estimate" } } */ -/* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-profile_estimate" } */ - -extern int global; - -int bar (int); - -void foo (int base, int bound) -{ - int i, ret = 0; - for (i = base; i <= bound; i++) - { - if (i < base) - global += bar (i); - if (i < base + 1) - global += bar (i); - if (i <= base + 3) - global += bar (i); - if (i - 1 < base) - global += bar (i); - } -} - -/* { dg-final { scan-tree-dump-times "loop iv compare heuristics: 0.0%" 4 "profile_estimate"} } */ -/* { dg-final { cleanup-tree-dump "profile_estimate" } } */