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: BCT optimization


	After looking over the BCT optimization code, it looks like it
should make much more use of the information calculated in
unroll.c:loop_iterations() instead of recalculating the values itself and
duplicating most of the code.  Because some of the information is in
static variables, I think that the BCT optimization functions should be
moved to unroll.c as well.  Does anyone object to this?

	The constant number of iteration case seems to collapse to using
loop_n_iterations, if the value is available, if there are enough
iterations to benefit, and if the additional conditions for this
optimization are met.

	I think that because of the order that loops are processed (inner
to outer) and all of the information calculated in loop_iterations(),
analyze_loop_iterations() could be removed and the decision to instrument
the loop with a BCT instruction decided in insert_bct() itself.  This also
would allow the optimization to avoid committing the count register unless
it actually was used for the loop (unrolling or other transformations
might make the optimization ineffective after the initial analysis thought
it profitable and committed the count register).

	The run-time number of iterations seems like it should be using
and/or mixed with loop preconditioning.  In this case it seems that
preconditioning should be orthogonal to loop unrolling (it currently is
intertwined with that optimization).  I don't know what to do about the
run-time iteration calculation currently in the BCT optimization until
this better calculation is implemented.  I think that the current code
actually is incorrect for corner cases and large iteration values, so I
think it probably needs to be removed altogether or at least disabled,
regardless of whether the better implementation is in place.

David


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