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]

Re: type conversion....



  In message <19980602115723.58044@atrey.karlin.mff.cuni.cz>you write:
  > I think it should be nice to add an interval information into each rtl,
  > and calculate the minimal and maximal values of each rtl and register.
  > This should let gcc to be much smarter about types, and propagate more
  > constants... For example when value is always in the interval 0-100, it should 
  > convert it into unsigned char, wich should help at some platforms. At intel it
  > should convert char value to integer (in case overflow in the calculation can
  > not happend) and such.  Also can convert signed to unsigned quite often IMO
  > ...
  > 
  > Calculating of intervals inside basic block should be easy, but not very
  > effective. I think it should be global, but calculating intervals in the
  > loops should be hard work. Only idea I have is following:
  > first calculate loop with original intervals in registers, then again, with
  > output intervals (this step should be repeated) and then intervals that still
  > changes change to +inf/-inf and repeat...  this should quite quicky converge
  > IMO...
This is known as value range propagation.  It's not particularly common in
productions compilers yet.  You should be able to find some papers on the
topic on the web if you look around for a while.


jeff


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