]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
lambda-code.c (can_convert_to_perfect_nest): Make checking match up with what perfect...
authorDaniel Berlin <dberlin@dberlin.org>
Sun, 19 Dec 2004 19:00:35 +0000 (19:00 +0000)
committerDaniel Berlin <dberlin@gcc.gnu.org>
Sun, 19 Dec 2004 19:00:35 +0000 (19:00 +0000)
2004-12-18  Daniel Berlin  <dberlin@dberlin.org>

        * lambda-code.c (can_convert_to_perfect_nest): Make checking
match up with what perfect_nestify can actually handle.
(perfect_nestify): Don't return false in the phi node loop.

From-SVN: r92381

gcc/ChangeLog
gcc/lambda-code.c

index 46a60630eb6f1bf3ec909cd5d049ad34c8521510..80cd75b1c348c8c6609f421ea14cab8968e33ac6 100644 (file)
@@ -1,3 +1,9 @@
+2004-12-18  Daniel Berlin  <dberlin@dberlin.org>
+
+        * lambda-code.c (can_convert_to_perfect_nest): Make checking
+       match up with what perfect_nestify can actually handle.
+       (perfect_nestify): Don't return false in the phi node loop.
+
 2004-12-18  Richard Henderson  <rth@redhat.com>
 
        * config/i386/i386.md (SSEINT16): New.
index 1fc3af52d9b6bf361e4f3dba5565f26831ec99b9..40f3ac368834df2650aaca4a8b23bf88e7b59f4d 100644 (file)
@@ -2189,9 +2189,10 @@ can_convert_to_perfect_nest (struct loop *loop,
                             VEC (tree) *loopivs)
 {
   basic_block *bbs;
-  tree exit_condition;
+  tree exit_condition, phi;
   size_t i;
   block_stmt_iterator bsi;
+  basic_block exitdest;
 
   /* Can't handle triply nested+ loops yet.  */
   if (!loop->inner || loop->inner->inner)
@@ -2233,6 +2234,16 @@ can_convert_to_perfect_nest (struct loop *loop,
            }
        }
     }  
+
+  /* We also need to make sure the loop exit only has simple copy phis in it,
+     otherwise we don't know how to transform it into a perfect nest right
+     now.  */
+  exitdest = loop->single_exit->dest;
+  
+  for (phi = phi_nodes (exitdest); phi; phi = PHI_CHAIN (phi))
+    if (PHI_NUM_ARGS (phi) != 1)
+      return false;
+
   return true;
 }
 
@@ -2309,9 +2320,6 @@ perfect_nestify (struct loops *loops,
 
   for (phi = phi_nodes (olddest); phi; phi = PHI_CHAIN (phi))
     {
-      /* These should be simple exit phi copies.  */
-      if (PHI_NUM_ARGS (phi) != 1)
-       return false;
       VEC_safe_push (tree, phis, PHI_RESULT (phi));
       VEC_safe_push (tree, phis, PHI_ARG_DEF (phi, 0));
       mark_for_rewrite (PHI_RESULT (phi));