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]
Other format: [Raw text]

Re: [tree-ssa]: Loop normalization pass


On Tuesday, January 14, 2003, at 11:12  AM, Steven Bosscher wrote:

Daniel Berlin wrote:
Normalizes loops to start at 1 (or would we rather 0), and have
 a stride of 1.

---- 8< ----
Since it wants loops to start at 1, rather than 0, it normalizes
a *ton* of loops, and thus, is pretty well tested in that respect.
If you are suggesting that most loops are only "normalized" because
their index starts at 0, then wouldn't it be better indeed to have
normalized loops start at 0 too?
Sure. I honestly don't care.
All the fortran loop optimizers i have source to normalize to 1
All the C loop optimizers I have source to normalize to 0.
I assume this is because these are the common lower bounds for these languages.
So I was at a loss which to choose, since we have both, and I presumed fortran95 is written by fortran programmers, and thus, they probably start their loops at 1 as well.


+/**
+ @brief Normalize a loop counter
+ @param lc Loop counter.
+ @param lc_rphi Phi reached from conditional used to exit loop
+ (i.e. in i > 49, the reaching def of i).
+ @param loop_start_bb Basic block which contains the LOOP_EXPR.
+ @return true if we normalized the loop counter, false if we
+ couldn't.

I've stopped making Doxy patches because Diego thinks they're ugly, and
I agree with him. Since your patch has them, I guess Diego didn't tell
you. Maybe we should make a decision about this now, because it is a
lot of work to put them in now, and more work to rip 'm out again later.

Okeydokey.

....

Dummy question: Is there a way or a plan to allow a single loop to be
normalized if constant propagation "discovers" that the loop counter
stride is constant?  This will probably quite often be the case for
Fortran 95, when constant propagation should be able to propagate array
section  sizes and strides.
I presumed loop norm would run after CCP, even though it runs before it right now.

Greetz
Steven








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