pr36648.cc: Disable cunrolli
authorJan Hubicka <hubicka@ucw.cz>
Thu, 16 Jun 2016 12:54:31 +0000 (14:54 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Thu, 16 Jun 2016 12:54:31 +0000 (12:54 +0000)
* g++.dg/vect/pr36648.cc: Disable cunrolli
* tree-ssa-loop-ivcanon.c (tree_estimate_loop_size): Fix estimation
of comparsions in the last iteration.

From-SVN: r237527

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/vect/pr36648.cc
gcc/tree-ssa-loop-ivcanon.c

index 8847e672972219e3d400ac31d0985a940e98b597..087a2f720f4b7b133bca39cde888d4dcb4d50005 100644 (file)
@@ -1,3 +1,8 @@
+2016-06-16  Jan Hubicka  <hubicka@ucw.cz>
+
+       * tree-ssa-loop-ivcanon.c (tree_estimate_loop_size): Fix estimation
+       of comparsions in the last iteration.
+
 2016-06-16  Claudiu Zissulescu  <claziss@synopsys.com>
            Joern Rennecke  <joern.rennecke@embecosm.com>
 
index b4a20edf9d078800a6b7804fc47d81d30e11cb70..8eff41d24a7b1ed7d608b8a762fea640a70a315e 100644 (file)
@@ -1,3 +1,7 @@
+2016-06-16  Jan Hubicka  <hubicka@ucw.cz>
+
+       * g++.dg/vect/pr36648.cc: Disable cunrolli
+
 2016-06-16  Jakub Jelinek  <jakub@redhat.com>
 
        PR target/71554
index e2347d2901278a52aa09cea3a7b5577890b82c22..450ac75b60751f282e43f2292b4db506f3c46913 100644 (file)
@@ -1,4 +1,5 @@
 /* { dg-require-effective-target vect_float } */
+// { dg-additional-options "-fdisable-tree-cunrolli" }
 
 struct vector
 {
index fff28ee8712f41e1d0594ffaef5911260a60c72e..76ecba4b7e8ce37f8fd26ed3b5016b653c267852 100644 (file)
@@ -255,69 +255,73 @@ tree_estimate_loop_size (struct loop *loop, edge exit, edge edge_to_cancel,
 
          /* Look for reasons why we might optimize this stmt away. */
 
-         if (gimple_has_side_effects (stmt))
-           ;
-         /* Exit conditional.  */
-         else if (exit && body[i] == exit->src
-                  && stmt == last_stmt (exit->src))
+         if (!gimple_has_side_effects (stmt))
            {
-             if (dump_file && (dump_flags & TDF_DETAILS))
-               fprintf (dump_file, "   Exit condition will be eliminated "
-                        "in peeled copies.\n");
-             likely_eliminated_peeled = true;
-           }
-         else if (edge_to_cancel && body[i] == edge_to_cancel->src
-                  && stmt == last_stmt (edge_to_cancel->src))
-           {
-             if (dump_file && (dump_flags & TDF_DETAILS))
-               fprintf (dump_file, "   Exit condition will be eliminated "
-                        "in last copy.\n");
-             likely_eliminated_last = true;
-           }
-         /* Sets of IV variables  */
-         else if (gimple_code (stmt) == GIMPLE_ASSIGN
-             && constant_after_peeling (gimple_assign_lhs (stmt), stmt, loop))
-           {
-             if (dump_file && (dump_flags & TDF_DETAILS))
-               fprintf (dump_file, "   Induction variable computation will"
-                        " be folded away.\n");
-             likely_eliminated = true;
-           }
-         /* Assignments of IV variables.  */
-         else if (gimple_code (stmt) == GIMPLE_ASSIGN
-                  && TREE_CODE (gimple_assign_lhs (stmt)) == SSA_NAME
-                  && constant_after_peeling (gimple_assign_rhs1 (stmt), stmt,
-                                             loop)
-                  && (gimple_assign_rhs_class (stmt) != GIMPLE_BINARY_RHS
-                      || constant_after_peeling (gimple_assign_rhs2 (stmt),
-                                                 stmt, loop)))
-           {
-             size->constant_iv = true;
-             if (dump_file && (dump_flags & TDF_DETAILS))
-               fprintf (dump_file,
-                        "   Constant expression will be folded away.\n");
-             likely_eliminated = true;
-           }
-         /* Conditionals.  */
-         else if ((gimple_code (stmt) == GIMPLE_COND
-                   && constant_after_peeling (gimple_cond_lhs (stmt), stmt,
-                                              loop)
-                   && constant_after_peeling (gimple_cond_rhs (stmt), stmt,
-                                              loop)
-                   /* We don't simplify all constant compares so make sure
-                      they are not both constant already.  See PR70288.  */
-                   && (! is_gimple_min_invariant (gimple_cond_lhs (stmt))
-                       || ! is_gimple_min_invariant (gimple_cond_rhs (stmt))))
-                  || (gimple_code (stmt) == GIMPLE_SWITCH
-                      && constant_after_peeling (gimple_switch_index (
-                                                   as_a <gswitch *> (stmt)),
+             /* Exit conditional.  */
+             if (exit && body[i] == exit->src
+                 && stmt == last_stmt (exit->src))
+               {
+                 if (dump_file && (dump_flags & TDF_DETAILS))
+                   fprintf (dump_file, "   Exit condition will be eliminated "
+                            "in peeled copies.\n");
+                 likely_eliminated_peeled = true;
+               }
+             if (edge_to_cancel && body[i] == edge_to_cancel->src
+                 && stmt == last_stmt (edge_to_cancel->src))
+               {
+                 if (dump_file && (dump_flags & TDF_DETAILS))
+                   fprintf (dump_file, "   Exit condition will be eliminated "
+                            "in last copy.\n");
+                 likely_eliminated_last = true;
+               }
+             /* Sets of IV variables  */
+             if (gimple_code (stmt) == GIMPLE_ASSIGN
+                 && constant_after_peeling (gimple_assign_lhs (stmt), stmt, loop))
+               {
+                 if (dump_file && (dump_flags & TDF_DETAILS))
+                   fprintf (dump_file, "   Induction variable computation will"
+                            " be folded away.\n");
+                 likely_eliminated = true;
+               }
+             /* Assignments of IV variables.  */
+             else if (gimple_code (stmt) == GIMPLE_ASSIGN
+                      && TREE_CODE (gimple_assign_lhs (stmt)) == SSA_NAME
+                      && constant_after_peeling (gimple_assign_rhs1 (stmt),
                                                  stmt, loop)
-                      && ! is_gimple_min_invariant
-                              (gimple_switch_index (as_a <gswitch *> (stmt)))))
-           {
-             if (dump_file && (dump_flags & TDF_DETAILS))
-               fprintf (dump_file, "   Constant conditional.\n");
-             likely_eliminated = true;
+                      && (gimple_assign_rhs_class (stmt) != GIMPLE_BINARY_RHS
+                          || constant_after_peeling (gimple_assign_rhs2 (stmt),
+                                                     stmt, loop)))
+               {
+                 size->constant_iv = true;
+                 if (dump_file && (dump_flags & TDF_DETAILS))
+                   fprintf (dump_file,
+                            "   Constant expression will be folded away.\n");
+                 likely_eliminated = true;
+               }
+             /* Conditionals.  */
+             else if ((gimple_code (stmt) == GIMPLE_COND
+                       && constant_after_peeling (gimple_cond_lhs (stmt), stmt,
+                                                  loop)
+                       && constant_after_peeling (gimple_cond_rhs (stmt), stmt,
+                                                  loop)
+                       /* We don't simplify all constant compares so make sure
+                          they are not both constant already.  See PR70288.  */
+                       && (! is_gimple_min_invariant (gimple_cond_lhs (stmt))
+                           || ! is_gimple_min_invariant
+                                (gimple_cond_rhs (stmt))))
+                      || (gimple_code (stmt) == GIMPLE_SWITCH
+                          && constant_after_peeling (gimple_switch_index (
+                                                       as_a <gswitch *>
+                                                         (stmt)),
+                                                     stmt, loop)
+                          && ! is_gimple_min_invariant
+                                  (gimple_switch_index
+                                     (as_a <gswitch *> (stmt)))))
+               {
+                 if (dump_file && (dump_flags & TDF_DETAILS))
+                   fprintf (dump_file, "   Constant conditional.\n");
+                 likely_eliminated = true;
+               }
            }
 
          size->overall += num;