RFA: check_dbra_loop
Richard Kenner
kenner@vlsi1.ultra.nyu.edu
Sun May 13 06:17:00 GMT 2001
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.
More information about the Gcc
mailing list