public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Daniel Berlin <dberlin@dberlin.org>
To: Richard Guenther <rguenth@tat.physik.uni-tuebingen.de>
Cc: gcc@gcc.gnu.org
Subject: Re: Simple loops not interchanged?
Date: Fri, 10 Dec 2004 16:34:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.60.0412101129200.25301@dberlin.org> (raw)
In-Reply-To: <Pine.LNX.4.44.0412101616530.4584-100000@alwazn.tat.physik.uni-tuebingen.de>



On Fri, 10 Dec 2004, Richard Guenther wrote:

> Hi!
>
> I expected -ftree-loop-linear to exchange loops in
>
> double foo(double *a)
> {
>        int i,j;
>        double r = 0.0;
> 	for (i=0; i<8; ++i)
>                for (j=0; j<8; ++j)
> 			r += a[j*8+i];
>        return r;
> }
>
> but it tells me (regardless of loop order) that
> "Won't transform loop. Optimal transform is the identity transform"
> which I cannot believe, obviously.

Unfortunately, there is no array_ref in these :(

> What's going wrong here?

The data dependence analyzer doesn't understand pointer-refs.

I started to make it nuderstand them on the autovect branch, but i'm not 
sure it's good enough yet to disambiguate your case (as easy as it may 
seem).

In fact, it doesn't, though it does see the data reference.


Data ref b:
(Data Ref:
   stmt: D.1134_18 = *D.1133_17;
   ref: *D.1133_17;
   base_name: a_16
   Access function 0: {{a_16, +, 8B}_1, +, 64B}_2
)
affine dependence test not usable: access function not affine or constant.
(dependence classified: scev_not_known)
)


When we don't know the data dependences of the loop, we can't touch them 
(the message it prints should probably be changed in that case :P)

--Dan

  parent reply	other threads:[~2004-12-10 16:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-10 15:36 Richard Guenther
2004-12-10 16:21 ` Andrew Pinski
2004-12-10 16:39   ` Daniel Berlin
2004-12-10 16:34 ` Daniel Berlin [this message]
2004-12-12  3:58   ` [autovect][PATCH]: " Daniel Berlin
2004-12-12 17:59     ` Devang Patel
2004-12-12 18:02       ` Daniel Berlin
2004-12-13  9:46     ` Sebastian Pop

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.60.0412101129200.25301@dberlin.org \
    --to=dberlin@dberlin.org \
    --cc=gcc@gcc.gnu.org \
    --cc=rguenth@tat.physik.uni-tuebingen.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).