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]

Re: Patch to improve local-alloc invariant handling


> This changes some uses of function_invariant_p to rtx_varies_p
> which knows about more invariants.  This patch passes make bootstrap
> and make check on IBM AIX 4.3, Solaris 7 SPARC, Compaq Tru64 UNIX 4.0f
> and FreeBSD-3.5 x86.

BTW, the effect of this patch is to change:

  (note 39 2 4 [bb 0] NOTE_INSN_BASIC_BLOCK -1347440721)

  ...

  (insn 12 5 13 (set (reg:SI 108)
          (high:SI (symbol_ref:SI ("a")))) -1 (nil)
      (nil))

  (insn 13 12 15 (set (reg:SI 107)
          (lo_sum:SI (reg:SI 108)
              (symbol_ref:SI ("a")))) -1 (nil)
      (expr_list:REG_DEAD (reg:SI 108)
          (nil)))

  ...

  (note 42 25 27 [bb 3] NOTE_INSN_BASIC_BLOCK -1347440721)

  (insn 27 42 28 (set (reg:QI 111)
          (mem/s:QI (plus:SI (reg:SI 107)
                  (reg:SI 109)) 0)) -1 (nil)
      (expr_list:REG_DEAD (reg:SI 107)
          (expr_list:REG_DEAD (reg:SI 109)
              (nil))))


into:

  (note 39 2 4 [bb 0] NOTE_INSN_BASIC_BLOCK -1347440721)

  ...
  
  (note 12 5 13 NOTE_INSN_DELETED 0)

  (note 13 12 15 NOTE_INSN_DELETED 0)

  ...

  (note 42 25 45 [bb 3] NOTE_INSN_BASIC_BLOCK -1347440721)

  (insn 45 42 44 (set (reg:SI 108)
          (high:SI (symbol_ref:SI ("a")))) 53 {*movsi_high} (nil)
      (expr_list:REG_EQUIV (high:SI (symbol_ref:SI ("a")))
          (nil)))

  (insn 44 45 27 (set (reg:SI 107)
          (lo_sum:SI (reg:SI 108)
              (symbol_ref:SI ("a")))) 52 {*movsi_lo_sum} (nil)
      (expr_list:REG_EQUIV (lo_sum:SI (reg:SI 108)
              (symbol_ref:SI ("a")))
          (expr_list:REG_DEAD (reg:SI 108)
              (nil))))

  (insn 27 44 28 (set (reg:QI 111)
          (mem/s:QI (plus:SI (reg:SI 107)
                  (reg:SI 109)) 0)) 46 {*movqi_insn} (nil)
      (expr_list:REG_DEAD (reg:SI 107)
          (expr_list:REG_DEAD (reg:SI 109)
              (nil))))

which allows for better register allocation.

-- John
-------------------------------------------------------------------------
|   Feith Systems  |   Voice: 1-215-646-8000  |  Email: john@feith.com  |
|    John Wehle    |     Fax: 1-215-540-5495  |                         |
-------------------------------------------------------------------------


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