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

[Bug rtl-optimization/32283] Missed induction variable optimization



------- Comment #16 from rakdver at kam dot mff dot cuni dot cz  2007-12-05 16:42 -------
Subject: Re:  Missed induction variable optimization

> Please correct me if I am wrong, but I think that optimizing out the variable
> that holds number of iterations is not desirable on targets that have doloop
> machine idiom, because doloop rtl pass will re-introduce it in a specially
> designated register.  However, ia64 does not allow arithmetic operations with
> loop counter, so it would be nice if iv-opts transformed the loop to the form
> where decrement-and-branch-on-zero are the only uses of this variable, when
> possible. 

On the other hand, performing induction variable elimination is also
clearly desirable, as doloop idiom cannot be applied in many common
cases.  At the moment, it does not seem feasible to introduce enough
target knowledge to ivopts to ensure that it can determine whether
it will be possible to determine whether the doloop pattern can be used.

I have no real idea how to solve this problem.  Probably the cleanest
way would be to somehow preserve the information about the number of
iterations of the loop determined on trees, and pass it to doloop, but
we lack the means to do that reliably.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32283


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