[PATCH 1/3] haifa-sched.c: make ready_list an auto_vec<rtx_insn *>

tbsaunde+gcc@tbsaunde.org tbsaunde+gcc@tbsaunde.org
Thu Aug 25 06:42:00 GMT 2016


From: Trevor Saunders <tbsaunde+gcc@tbsaunde.org>

gcc/ChangeLog:

2016-08-25  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* haifa-sched.c (fix_recovery_deps): Make ready_list a vector.
---
 gcc/haifa-sched.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index 84e42c0..c58b0ad 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -8600,9 +8600,8 @@ static void
 fix_recovery_deps (basic_block rec)
 {
   rtx_insn *note, *insn, *jump;
-  rtx_insn_list *ready_list = 0;
+  auto_vec<rtx_insn *, 10> ready_list;
   bitmap_head in_ready;
-  rtx_insn_list *link;
 
   bitmap_initialize (&in_ready, 0);
 
@@ -8628,7 +8627,7 @@ fix_recovery_deps (basic_block rec)
 	      sd_delete_dep (sd_it);
 
 	      if (bitmap_set_bit (&in_ready, INSN_LUID (consumer)))
-		ready_list = alloc_INSN_LIST (consumer, ready_list);
+		ready_list.safe_push (consumer);
 	    }
 	  else
 	    {
@@ -8645,9 +8644,10 @@ fix_recovery_deps (basic_block rec)
   bitmap_clear (&in_ready);
 
   /* Try to add instructions to the ready or queue list.  */
-  for (link = ready_list; link; link = link->next ())
-    try_ready (link->insn ());
-  free_INSN_LIST_list (&ready_list);
+  unsigned int i;
+  rtx_insn *temp;
+  FOR_EACH_VEC_ELT_REVERSE (ready_list, i, temp)
+    try_ready (temp);
 
   /* Fixing jump's dependences.  */
   insn = BB_HEAD (rec);
-- 
2.9.0



More information about the Gcc-patches mailing list