On 10/06/2015 03:37 PM, tbsaunde+...@tbsaunde.org wrote:
This seems a bit cleaner, and should involve less allocation.

I agree this is good. rtx_insn_list should die.

I tested there was no regressions for sh-sim with all languages accept
ada,lto,fortran, ok?

Could you please also build a few large source files and compare before/after code generation to ensure there are no changes? I always try to do this for patches like this one to avoid accidents, and this change looks sufficiently non-mechanical to warrant it. Could also test mips-elf.

        * reorg.c (emit_delay_sequence): store list of delay slot insns
        in a vector instead of rtx_insn_list.

Capitalize sentences.

        (redundant_insn): Likewise.
                        (fill_simple_delay_slots): Likewise.
                        (fill_slots_from_thread): Likewise.

And fix the formatting.

@@ -1602,12 +1577,11 @@ redundant_insn (rtx insn, rtx_insn *target, rtx 
delay_list)
    /* This insn isn't redundant if it conflicts with an insn that either is
       or will be in a delay slot of TARGET.  */

-  while (delay_list)
-    {
-      if (insn_sets_resource_p (XEXP (delay_list, 0), &needed, true))
-       return 0;
-      delay_list = XEXP (delay_list, 1);
-    }
+      unsigned int j;
+      rtx_insn *temp;
+      FOR_EACH_VEC_ELT (delay_list, j, temp)
+       if (insn_sets_resource_p (temp, &needed, true))
+         return 0;

There could be formatting problems, but maybe it's an email artifact. Please double-check.

@@ -3304,7 +3258,7 @@ relax_delay_slots (rtx_insn *first)
       /* See if the first insn in the delay slot is redundant with some
         previous insn.  Remove it from the delay slot if so; then set up
         to reprocess this insn.  */
-      if (redundant_insn (pat->insn (1), delay_insn, 0))
+      if (redundant_insn (pat->insn (1), delay_insn, auto_vec<rtx_insn *> ()))
        {
          update_block (pat->insn (1), insn);
          delete_from_delay_slot (pat->insn (1));

This bit looks a little ugly. Not really sure how to fix it other than having an "always empty" vector for this purpose. But that's probably an unnecessary complication too.

Other than that looks good.


Bernd

Reply via email to