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: Value Range Propagation Pass Status


> Could your pass be run before loop optimisation so that we can acquire
> this information for the loop optimizer?

I imagine so.  The value range propagation pass doesn't handle
pre_dec, post_dec, etc. side effects so it can't run after flow.
It's currently a little weak on determining both the min and
max of loop variables.  I.e.:

  int i;

  for (i = 0; i < 10; i++)
   subr();

produces:

BB 1
    reg 24
        min <integer_cst 8297f34 -2147483648>        max <integer_cst 8297f98 9>

and:

  int i;

  for (i = 10; i >= 0; i--)
    subr();

produces:

BB 1
    reg 24
        min <integer_cst 8297f34 0>        max <integer_cst 8297f98 2147483647>

I'd like to find time to address this problem.  Also, the information
is deleted once the pass has completed (though this is easily changed).

Initially I was planning on running it before gcse.  This allows gcse
to realize in the case of:

BB 0
     pseudo register 24 = expression 1
     if some condition which never meet then BB 1
     ...
     goto BB 2

BB 1
     pseudo register 24 = expression 2
     ...

BB 2
     pseudo register 25 = expression 1

that expression 1 in pseudo register 24 reaches BB 2 and is not killed
by BB 1.  This should help reduce the number of new registers generated
by gcse.

-- 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]