This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 12/18] haifa-sched.c: make insn_queue[] a vec<rtx_insn *>


On 04/25/2016 04:17 PM, Trevor Saunders wrote:
On Mon, Apr 25, 2016 at 03:55:15PM +0200, Bernd Schmidt wrote:
On 04/20/2016 08:22 AM, tbsaunde+gcc@tbsaunde.org wrote:
-/* Remove INSN from queue.  */
+/* Remove INSN at idx from queue.  */
+static void
+queue_remove (unsigned int q, unsigned int idx)
+{
+  QUEUE_INDEX (insn_queue[q][idx]) = QUEUE_NOWHERE;
+  insn_queue[q].ordered_remove (idx);
+  q_size--;

I think I'm nacking this one, sorry. I don't think ordered_removes in the
scheduler queues are going to fly.

So, we're going from a linear walk through a linked list to linear scan
of part of a vector and memcpy of the rest.  That's certainly not great,
but the linked list walk doesn't seem great either.  Is unordered_remove
here safe?  Or do you have some other idea?  I guess we could write a
forward_list.

After looking at it for a bit, I think unordered_remove for the queues (leaving the ready list alone entirely) is probably alright. I think here in particular but also for the other patches it would be good to run some tests that code generation is identical before and after.


Bernd


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]