OSDN Git Service

* df-scan.c (df_ref_chain_change_bb): Simplify.
authoraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 1 Mar 2008 03:36:43 +0000 (03:36 +0000)
committeraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 1 Mar 2008 03:36:43 +0000 (03:36 +0000)
(df_insn_change_bb): Add new_bb argument.  Simplify.  Call
set_block_for_insn if there's any change.
* df.h ((df_insn_change_bb): Fix prototype.
* cfgrtl.c (update_bb_for_insn_chain): Pass bb to
df_insn_change_bb, don't call set_block_for_insn.
* emit-rtl.c (reorder_insns): Likewise.
* haifa-sched.c (move_insn): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@132795 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/cfgrtl.c
gcc/df-scan.c
gcc/df.h
gcc/emit-rtl.c
gcc/haifa-sched.c

index 7946075..96a538c 100644 (file)
@@ -1,5 +1,16 @@
 2008-03-01  Alexandre Oliva  <aoliva@redhat.com>
 
 2008-03-01  Alexandre Oliva  <aoliva@redhat.com>
 
+       * df-scan.c (df_ref_chain_change_bb): Simplify.
+       (df_insn_change_bb): Add new_bb argument.  Simplify.  Call
+       set_block_for_insn if there's any change.
+       * df.h ((df_insn_change_bb): Fix prototype.
+       * cfgrtl.c (update_bb_for_insn_chain): Pass bb to
+       df_insn_change_bb, don't call set_block_for_insn.
+       * emit-rtl.c (reorder_insns): Likewise.
+       * haifa-sched.c (move_insn): Likewise.
+
+2008-03-01  Alexandre Oliva  <aoliva@redhat.com>
+
        * rtlanal.c (loc_mentioned_in_p): Test XVECEXPs correctly.
 
 2008-03-01  Alexandre Oliva  <aoliva@redhat.com>
        * rtlanal.c (loc_mentioned_in_p): Test XVECEXPs correctly.
 
 2008-03-01  Alexandre Oliva  <aoliva@redhat.com>
index 1b9c505..c157e08 100644 (file)
@@ -1,6 +1,6 @@
 /* Control flow graph manipulation code for GNU compiler.
    Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
 /* Control flow graph manipulation code for GNU compiler.
    Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
    Free Software Foundation, Inc.
 
 This file is part of GCC.
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -477,13 +477,8 @@ update_bb_for_insn_chain (rtx begin, rtx end, basic_block bb)
 
   end = NEXT_INSN (end);
   for (insn = begin; insn != end; insn = NEXT_INSN (insn))
 
   end = NEXT_INSN (end);
   for (insn = begin; insn != end; insn = NEXT_INSN (insn))
-    {
-      if (!BARRIER_P (insn))
-       {
-         set_block_for_insn (insn, bb);
-         df_insn_change_bb (insn);
-       }
-    }
+    if (!BARRIER_P (insn))
+      df_insn_change_bb (insn, bb);
 }
 
 /* Update BLOCK_FOR_INSN of insns in BB to BB,
 }
 
 /* Update BLOCK_FOR_INSN of insns in BB to BB,
index f3a9026..3dc759c 100644 (file)
@@ -1,6 +1,6 @@
 /* Scanning of rtl for dataflow analysis.
 /* Scanning of rtl for dataflow analysis.
-   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
-   Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+   2008  Free Software Foundation, Inc.
    Originally contributed by Michael P. Hayes 
              (m.hayes@elec.canterbury.ac.nz, mhayes@redhat.com)
    Major rewrite contributed by Danny Berlin (dberlin@dberlin.org)
    Originally contributed by Michael P. Hayes 
              (m.hayes@elec.canterbury.ac.nz, mhayes@redhat.com)
    Major rewrite contributed by Danny Berlin (dberlin@dberlin.org)
@@ -1753,14 +1753,10 @@ df_maybe_reorganize_def_refs (enum df_ref_order order)
 }
 
 
 }
 
 
-/* Change the BB of all refs in the ref chain to NEW_BB.
-   Assumes that all refs in the chain have the same BB.
-   If changed, return the original bb the chain belonged to
-   (or .
-   If no change, return NEW_BB. 
-   If something's wrong, it will return NULL. */
+/* Change the BB of all refs in the ref chain from OLD_BB to NEW_BB.
+   Assumes that all refs in the chain have the same BB.  */
 
 
-static basic_block
+static void
 df_ref_chain_change_bb (struct df_ref **ref_rec, 
                         basic_block old_bb,
                         basic_block new_bb)
 df_ref_chain_change_bb (struct df_ref **ref_rec, 
                         basic_block old_bb,
                         basic_block new_bb)
@@ -1769,18 +1765,10 @@ df_ref_chain_change_bb (struct df_ref **ref_rec,
     {
       struct df_ref *ref = *ref_rec;
 
     {
       struct df_ref *ref = *ref_rec;
 
-      if (DF_REF_BB (ref) == new_bb)
-       return new_bb;
-      else
-       {
-         gcc_assert (old_bb == NULL || DF_REF_BB (ref) == old_bb);
-         old_bb = DF_REF_BB (ref);
-         DF_REF_BB (ref) = new_bb;
-       }
+      gcc_assert (DF_REF_BB (ref) == old_bb);
+      DF_REF_BB (ref) = new_bb;
       ref_rec++;
     }
       ref_rec++;
     }
-
-  return old_bb;
 }
 
 
 }
 
 
@@ -1789,13 +1777,17 @@ df_ref_chain_change_bb (struct df_ref **ref_rec,
    instructions from one block to another.  */  
 
 void
    instructions from one block to another.  */  
 
 void
-df_insn_change_bb (rtx insn)
+df_insn_change_bb (rtx insn, basic_block new_bb)
 {
 {
-  basic_block new_bb = BLOCK_FOR_INSN (insn);
-  basic_block old_bb = NULL;
+  basic_block old_bb = BLOCK_FOR_INSN (insn);
   struct df_insn_info *insn_info;
   unsigned int uid = INSN_UID (insn);
 
   struct df_insn_info *insn_info;
   unsigned int uid = INSN_UID (insn);
 
+  if (old_bb == new_bb)
+    return;
+
+  set_block_for_insn (insn, new_bb);
+
   if (!df)
     return;
 
   if (!df)
     return;
 
@@ -1814,17 +1806,9 @@ df_insn_change_bb (rtx insn)
   if (!INSN_P (insn))
     return;
 
   if (!INSN_P (insn))
     return;
 
-  old_bb = df_ref_chain_change_bb (insn_info->defs, old_bb, new_bb);
-  if (old_bb == new_bb) 
-    return;
-
-  old_bb = df_ref_chain_change_bb (insn_info->uses, old_bb, new_bb);
-  if (old_bb == new_bb) 
-    return;
-
-  old_bb = df_ref_chain_change_bb (insn_info->eq_uses, old_bb, new_bb);
-  if (old_bb == new_bb) 
-    return;
+  df_ref_chain_change_bb (insn_info->defs, old_bb, new_bb);
+  df_ref_chain_change_bb (insn_info->uses, old_bb, new_bb);
+  df_ref_chain_change_bb (insn_info->eq_uses, old_bb, new_bb);
 
   df_set_bb_dirty (new_bb);
   if (old_bb)
 
   df_set_bb_dirty (new_bb);
   if (old_bb)
index 8beadc9..7c14f16 100644 (file)
--- a/gcc/df.h
+++ b/gcc/df.h
@@ -1,6 +1,6 @@
 /* Form lists of pseudo register references for autoinc optimization
    for GNU compiler.  This is part of flow optimization.
 /* Form lists of pseudo register references for autoinc optimization
    for GNU compiler.  This is part of flow optimization.
-   Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007
+   Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007, 2008
    Free Software Foundation, Inc.
    Originally contributed by Michael P. Hayes 
              (m.hayes@elec.canterbury.ac.nz, mhayes@redhat.com)
    Free Software Foundation, Inc.
    Originally contributed by Michael P. Hayes 
              (m.hayes@elec.canterbury.ac.nz, mhayes@redhat.com)
@@ -871,7 +871,7 @@ extern bool df_insn_rescan (rtx);
 extern void df_insn_rescan_all (void);
 extern void df_process_deferred_rescans (void);
 extern void df_recompute_luids (basic_block);
 extern void df_insn_rescan_all (void);
 extern void df_process_deferred_rescans (void);
 extern void df_recompute_luids (basic_block);
-extern void df_insn_change_bb (rtx);
+extern void df_insn_change_bb (rtx, basic_block);
 extern void df_maybe_reorganize_use_refs (enum df_ref_order);
 extern void df_maybe_reorganize_def_refs (enum df_ref_order);
 extern void df_ref_change_reg_with_loc (int, int, rtx);
 extern void df_maybe_reorganize_use_refs (enum df_ref_order);
 extern void df_maybe_reorganize_def_refs (enum df_ref_order);
 extern void df_ref_change_reg_with_loc (int, int, rtx);
index 36997cd..8628d52 100644 (file)
@@ -3737,10 +3737,7 @@ reorder_insns (rtx from, rtx to, rtx after)
 
       for (x = from; x != NEXT_INSN (to); x = NEXT_INSN (x))
        if (!BARRIER_P (x))
 
       for (x = from; x != NEXT_INSN (to); x = NEXT_INSN (x))
        if (!BARRIER_P (x))
-         {
-           set_block_for_insn (x, bb);
-           df_insn_change_bb (x);
-         }
+         df_insn_change_bb (x, bb);
     }
 }
 
     }
 }
 
index 6a53543..0f12cd0 100644 (file)
@@ -1,6 +1,7 @@
 /* Instruction scheduling pass.
    Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
 /* Instruction scheduling pass.
    Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-   2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+   2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+   Free Software Foundation, Inc.
    Contributed by Michael Tiemann (tiemann@cygnus.com) Enhanced by,
    and currently maintained by, Jim Wilson (wilson@cygnus.com)
 
    Contributed by Michael Tiemann (tiemann@cygnus.com) Enhanced by,
    and currently maintained by, Jim Wilson (wilson@cygnus.com)
 
@@ -1835,8 +1836,7 @@ move_insn (rtx insn)
          gcc_assert (BB_END (bb) == last);
        }
 
          gcc_assert (BB_END (bb) == last);
        }
 
-      set_block_for_insn (insn, bb);    
-      df_insn_change_bb (insn);
+      df_insn_change_bb (insn, bb);
   
       /* Update BB_END, if needed.  */
       if (BB_END (bb) == last)
   
       /* Update BB_END, if needed.  */
       if (BB_END (bb) == last)