public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* memrefs_conflict_p () for REGs in alias.c
@ 2002-09-30 22:03 George H
  2002-09-30 22:13 ` David S. Miller
  2002-10-01 14:02 ` Richard Henderson
  0 siblings, 2 replies; 5+ messages in thread
From: George H @ 2002-09-30 22:03 UTC (permalink / raw)
  To: gcc

While looking at the following piece of code, in
memrefs_conflict_p () in alias.c
   if (GET_CODE (x) == GET_CODE (y))
    switch (GET_CODE (x)) 
    { 
           ......          

       case REG:
           if (alias_invariant)
           {
               .....
           }
           break;
     }
     ....
     return 1;

I found that it always returns 1 for cse in case of
REG, as the alias_invariant array is NULL. The
alias_invariant is being set in loop unrolling pass
which happens much later than cse.  Thus, in cse we
always assume that the two regs always conflict. This
seems to be too pessimistic as there may be cases
where the addresses contained in two regs may be
different. Can we add some intelligence in the
compiler here?

-gh

__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: memrefs_conflict_p () for REGs in alias.c
  2002-09-30 22:03 memrefs_conflict_p () for REGs in alias.c George H
@ 2002-09-30 22:13 ` David S. Miller
  2002-09-30 22:19   ` George H
  2002-10-01 14:02 ` Richard Henderson
  1 sibling, 1 reply; 5+ messages in thread
From: David S. Miller @ 2002-09-30 22:13 UTC (permalink / raw)
  To: grgh007; +Cc: gcc


Remove the "flag_unroll_loops" test in init_alias_analysis() and
see what happens.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: memrefs_conflict_p () for REGs in alias.c
  2002-09-30 22:13 ` David S. Miller
@ 2002-09-30 22:19   ` George H
  0 siblings, 0 replies; 5+ messages in thread
From: George H @ 2002-09-30 22:19 UTC (permalink / raw)
  To: David S. Miller; +Cc: gcc


--- "David S. Miller" <davem@redhat.com> wrote:
> 
> Remove the "flag_unroll_loops" test in
> init_alias_analysis() and
> see what happens.
Ya, I just saw that. that is as good as you specify
-funroll-loop option. it only allocates the memory for
alias_invariant array, but there is no meaningful
information in alias_invariant for cse.

-gh


__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: memrefs_conflict_p () for REGs in alias.c
  2002-09-30 22:03 memrefs_conflict_p () for REGs in alias.c George H
  2002-09-30 22:13 ` David S. Miller
@ 2002-10-01 14:02 ` Richard Henderson
  2002-10-03  5:57   ` George H
  1 sibling, 1 reply; 5+ messages in thread
From: Richard Henderson @ 2002-10-01 14:02 UTC (permalink / raw)
  To: George H; +Cc: gcc

On Mon, Sep 30, 2002 at 09:33:57PM -0700, George H wrote:
> I found that it always returns 1 for cse in case of REG...

Yes.  alias.c computes function invariants.  If a register
is set more than once, it varies, and thus there is no data
on what it points to.


r~

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: memrefs_conflict_p () for REGs in alias.c
  2002-10-01 14:02 ` Richard Henderson
@ 2002-10-03  5:57   ` George H
  0 siblings, 0 replies; 5+ messages in thread
From: George H @ 2002-10-03  5:57 UTC (permalink / raw)
  To: Richard Henderson; +Cc: gcc

> > I found that it always returns 1 for cse in case
> > of REG...
> 
> Yes.  alias.c computes function invariants.  If a
> register
> is set more than once, it varies, and thus there is
> no data
> on what it points to.
> 
> 
> r~

The only point I wanted to indicate is that there
seems to be no way of determining whether the
addresses contained in two REGs may be distinct.

e.g. base_alias_check () *only compares the base
addresses* of two REGs and assumes aliasing if they
match. 

The mechanism to know how the addresses in two REGs
have been computed is missing, which may help in
distinguishing the addresses.

-gh



__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-10-03  9:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-30 22:03 memrefs_conflict_p () for REGs in alias.c George H
2002-09-30 22:13 ` David S. Miller
2002-09-30 22:19   ` George H
2002-10-01 14:02 ` Richard Henderson
2002-10-03  5:57   ` George H

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).