tree-ssa-loop-ivopts.c (determine_iv_cost): Do not try to preserve artificial origina...
authorZdenek Dvorak <dvorakz@suse.cz>
Tue, 22 Mar 2005 22:08:53 +0000 (23:08 +0100)
committerZdenek Dvorak <rakdver@gcc.gnu.org>
Tue, 22 Mar 2005 22:08:53 +0000 (22:08 +0000)
* tree-ssa-loop-ivopts.c (determine_iv_cost): Do not try to preserve
artificial original candidates.

From-SVN: r96894

gcc/ChangeLog
gcc/tree-ssa-loop-ivopts.c

index a48a35e5a2e4e01ef9c4d96e4fc663e7579a8f86..9d0a7ef449993b7594fc2bed1633b2b3583683c1 100644 (file)
@@ -1,3 +1,8 @@
+2005-03-22  Zdenek Dvorak  <dvorakz@suse.cz>
+
+       * tree-ssa-loop-ivopts.c (determine_iv_cost): Do not try to preserve
+       artificial original candidates.
+
 2005-03-22  Richard Guenther <rguenth@tat.physik.uni-tuebingen.de>
            Jan Hubicka  <jh@suse.cz>
            Steven Bosscher <stevenb@suse.de
index 877f5e45a037482ca6da7f4b4342b2ebb017abdb..2544fbc966a9b0f55ccfca94c6519e70ccc348e9 100644 (file)
@@ -3681,8 +3681,11 @@ determine_iv_cost (struct ivopts_data *data, struct iv_cand *cand)
 
   cand->cost = cost_step + cost_base / AVG_LOOP_NITER (current_loop);
 
-  /* Prefer the original iv unless we may gain something by replacing it.  */
-  if (cand->pos == IP_ORIGINAL)
+  /* Prefer the original iv unless we may gain something by replacing it;
+     this is not really relevant for artificial ivs created by other
+     passes.  */
+  if (cand->pos == IP_ORIGINAL
+      && !DECL_ARTIFICIAL (SSA_NAME_VAR (cand->var_before)))
     cand->cost--;
   
   /* Prefer not to insert statements into latch unless there are some