aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/loop-unswitch-2.c
diff options
context:
space:
mode:
authorYuri Rumyantsev <ysrumyan@gmail.com>2015-10-08 13:14:09 +0000
committerIlya Enkovich <ienkovich@gcc.gnu.org>2015-10-08 13:14:09 +0000
commita01e93f11b7ce050679951dedae66e40bca6be4d (patch)
tree5f7294b8f0b81c4c83835b68641e48339dc64aa4 /gcc/testsuite/gcc.dg/loop-unswitch-2.c
parentf28ff5b5c504d19083ca474821475a04d0f46111 (diff)
downloadgcc-a01e93f11b7ce050679951dedae66e40bca6be4d.zip
gcc-a01e93f11b7ce050679951dedae66e40bca6be4d.tar.gz
gcc-a01e93f11b7ce050679951dedae66e40bca6be4d.tar.bz2
tree-ssa-loop-unswitch.c: Include "gimple-iterator.h" and "cfghooks.h"...
gcc/ * tree-ssa-loop-unswitch.c: Include "gimple-iterator.h" and "cfghooks.h", add prototypes for introduced new functions. (tree_ssa_unswitch_loops): Use from innermost loop iterator, move all checks on ability of loop unswitching to tree_unswitch_single_loop; invoke tree_unswitch_single_loop or tree_unswitch_outer_loop depending on innermost loop check. (tree_unswitch_single_loop): Add all required checks on ability of loop unswitching under zero recursive level guard. (tree_unswitch_outer_loop): New function. (find_loop_guard): Likewise. (empty_bb_without_guard_p): Likewise. (used_outside_loop_p): Likewise. (get_vop_from_header): Likewise. (hoist_guard): Likewise. (check_exit_phi): Likewise. gcc/testsuite/ * gcc.dg/loop-unswitch-2.c: New test. * gcc.dg/loop-unswitch-3.c: Likewise. * gcc.dg/loop-unswitch-4.c: Likewise. From-SVN: r228599
Diffstat (limited to 'gcc/testsuite/gcc.dg/loop-unswitch-2.c')
-rw-r--r--gcc/testsuite/gcc.dg/loop-unswitch-2.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/loop-unswitch-2.c b/gcc/testsuite/gcc.dg/loop-unswitch-2.c
new file mode 100644
index 0000000..5ebf608
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/loop-unswitch-2.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -funswitch-loops -fdump-tree-unswitch-details" } */
+
+void foo (float **a, float **b, float *c, int n, int m, int l)
+{
+ int i,j,k;
+ float s;
+ for (i=0; i<l; i++)
+ for (j=0; j<n; j++)
+ for (k=0; k<m; k++)
+ c[i] += a[i][k] * b[k][j];
+}
+
+/* { dg-final { scan-tree-dump-times "guard hoisted" 2 "unswitch" } } */
+