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: RFA: check_dbra_loop


    Now, it seems wrong on principle to me to try to ever base an
    optimization on loop_invariant_p *not* holding, since that function is
    conservative.  We never know for sure that something is *not* loop
    invariant; we only know that we cannot prove that it *is* loop
    invariant.

Agreed.

    (Furthermore, reversing a loop (in the naive way) seems bogus when
    there is *any* write to global memory because a program can tell the
    difference.  For example, consider a threaded program, where another
    thread is looking at the global continuously.  It should see the
    numbers count upwards, not downwards.  

Is this required even if "volatile" is not specified?

    So, I think this reversible_mem_store stuff is bogus, and that we are
    not currently smart enough to reverse any loop that writes to memory.

I think we *can* reverse the loop if the address of the store is a giv since
then we know that each write is disjoint.


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