This is the mail archive of the gcc@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]

reg_last_set_mode


I have been looking at combine.c and reg_last_set_mode.  This
array records for each register, what machine mode it was last
set with.  I have some observations, which I would love to have
corrected if they are misconceptions:

* It is only ever set in line 10640-ish of combine.c where
  it is set to the machine mode of its virtual register.  This
  makes it a no-op (you could just look up the mode of the
  register instead of using the reg_last_set_mode array) for
  virtual registers since they are always used in their own mode.

* It is used in line 7529-ist in nonzero_bits to determine whether
  the last setting of the register matches the mode we want to use
  it in.  If there is a match, we can use the value of
  reg_last_set_nonzero_bits for optimisations.  But if the
  mode doesn't match, we ignore questions of mode and use
  the values in reg_nonzero_bits[] which were calculated in
  exactly the same way, using a call to nonzero_bits().
  Apparently this works because nonzero_bits() took
  them into account when reg_nonzero_bits was made.  So is
  the check against reg_last_set_mode unecessary?

  If so, then the array is itself uneccessary, since that
  (and one analogous place) is the only place it is used.

Am I misunderstanding something here?

-- 
Erik Corry erik@arbat.com


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