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: Loop optimiser upgrade (Was RFC: BB duplication code)


> Load motion isn't as good as store motion yet, and leaves one r/o reg
> for loop to hoist.
> 
> However, i'm curious as to why we don't notice that r was invariant in
> the current loop code. 
> Any ideas?
It is because the invariant code simply "sees" that R is something
at loop entry and set to something else in the body.
It does not know that the value is used only with the new one as all analysis
it does it to look at variable's live range and see that variable is live
before the definition concluding it is used too.

Using DU/DF will solve it.

Anyway I think the loop invariant code, once PRE/store/load motion is at place
don't need to attempt to be smarter.  It should simply know that value is
invariant if it is not set in the loop, as other cases should be already put
away.

We only need invariant information to discover BIVs/GIVs incremented/multiplied
by invariant registers.

Honza


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