[patch] cse.c: Update comments.

Kazu Hirata kazu@cs.umass.edu
Mon Feb 7 22:23:00 GMT 2005


Hi,

Attached is a patch to update comments.

We used to have separate arrays for reg_qty, reg_in_table, etc.  Now
they are part of cse_reg_info and referenced through accessor macros
like REG_QTY, REG_IN_TABLE, etc.

Also, the invalid number for REG_QTY (N) is now -N - 1, not N, which
Roger changed last October or so.  See the last hunk for this change.

Committed as obvious.

Kazu Hirata

2005-02-07  Kazu Hirata  <kazu@cs.umass.edu>

	* cse.c: Update comments.

Index: cse.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cse.c,v
retrieving revision 1.340
diff -c -d -p -r1.340 cse.c
*** cse.c	2 Feb 2005 22:31:41 -0000	1.340
--- cse.c	7 Feb 2005 17:03:46 -0000
*************** Registers and "quantity numbers":
*** 80,90 ****
     copies one register into another, we copy the quantity number.
     When a register is loaded in any other way, we allocate a new
     quantity number to describe the value generated by this operation.
!    `reg_qty' records what quantity a register is currently thought
     of as containing.
  
     All real quantity numbers are greater than or equal to zero.
!    If register N has not been assigned a quantity, reg_qty[N] will
     equal -N - 1, which is always negative.
  
     Quantity numbers below zero do not exist and none of the `qty_table'
--- 80,90 ----
     copies one register into another, we copy the quantity number.
     When a register is loaded in any other way, we allocate a new
     quantity number to describe the value generated by this operation.
!    `REG_QTY (N)' records what quantity register N is currently thought
     of as containing.
  
     All real quantity numbers are greater than or equal to zero.
!    If register N has not been assigned a quantity, `REG_QTY (N)' will
     equal -N - 1, which is always negative.
  
     Quantity numbers below zero do not exist and none of the `qty_table'
*************** Other expressions:
*** 172,189 ****
     the register's new value.  This sequence of circumstances is rare
     within any one basic block.
  
!    The vectors `reg_tick' and `reg_in_table' are used to detect this case.
!    reg_tick[i] is incremented whenever a value is stored in register i.
!    reg_in_table[i] holds -1 if no references to register i have been
!    entered in the table; otherwise, it contains the value reg_tick[i] had
!    when the references were entered.  If we want to enter a reference
!    and reg_in_table[i] != reg_tick[i], we must scan and remove old references.
!    Until we want to enter a new entry, the mere fact that the two vectors
!    don't match makes the entries be ignored if anyone tries to match them.
  
     Registers themselves are entered in the hash table as well as in
!    the equivalent-register chains.  However, the vectors `reg_tick'
!    and `reg_in_table' do not apply to expressions which are simple
     register references.  These expressions are removed from the table
     immediately when they become invalid, and this can be done even if
     we do not immediately search for all the expressions that refer to
--- 172,191 ----
     the register's new value.  This sequence of circumstances is rare
     within any one basic block.
  
!    `REG_TICK' and `REG_IN_TABLE', accessors for members of
!    cse_reg_info, are used to detect this case.  REG_TICK (i) is
!    incremented whenever a value is stored in register i.
!    REG_IN_TABLE (i) holds -1 if no references to register i have been
!    entered in the table; otherwise, it contains the value REG_TICK (i)
!    had when the references were entered.  If we want to enter a
!    reference and REG_IN_TABLE (i) != REG_TICK (i), we must scan and
!    remove old references.  Until we want to enter a new entry, the
!    mere fact that the two vectors don't match makes the entries be
!    ignored if anyone tries to match them.
  
     Registers themselves are entered in the hash table as well as in
!    the equivalent-register chains.  However, `REG_TICK' and
!    `REG_IN_TABLE' do not apply to expressions which are simple
     register references.  These expressions are removed from the table
     immediately when they become invalid, and this can be done even if
     we do not immediately search for all the expressions that refer to
*************** static rtx this_insn;
*** 289,295 ****
  
     Or -1 if this register is at the end of the chain.
  
!    If reg_qty[N] == N, reg_eqv_table[N].next is undefined.  */
  
  /* Per-register equivalence chain.  */
  struct reg_eqv_elem
--- 291,297 ----
  
     Or -1 if this register is at the end of the chain.
  
!    If REG_QTY (N) == -N - 1, reg_eqv_table[N].next is undefined.  */
  
  /* Per-register equivalence chain.  */
  struct reg_eqv_elem



More information about the Gcc-patches mailing list