------- Comment #2 from spop at gcc dot gnu dot org  2007-08-31 14:06 -------
Subject: Re:  Missed opportunities for vectorization due to invariant condition

> Looks like -fno-tree-pre is not enough, because if PRE doesn't do it, then 
> sink
> does it. When I use "-O3 -ftree-vectorize -msse2 -fno-tree-pre -fno-tree-sink"
> I get the dataref problem you report below, without manual modifications to 
> the
> code
>

Apparently this is sink is triggered on -O3, Daniel also warned yesterday
about the fact that it's not PRE specific.

Actually, can't we move that code back in the loop body when
the vectorizer detects that code in the latch bb?

> > And with PRE disabled, the fail occurs in the data ref analysis:
> > ./linpk_corrected.f90:26: note: not vectorized: data ref analysis failed 
> > t.8_70
> > = (*a_25(D))[D.1406_69]
> > ./linpk_corrected.f90:26: note: bad data references.
>
> Just for the record, this is the dataref problem that the dataref analyzer
> reports:
>
> Creating dr for t
> analyze_innermost: (analyze_scalar_evolution
>   (loop_nb = 3)
>   (scalar = &t)
> (get_scalar_evolution
>   (scalar = &t)
>   (scalar_evolution = ))
> )
> success.
>         base_address: &t
>         offset from base address: 0
>         constant offset from base address: 0
>         step: 0
>         aligned to: 128
>         base_object: t
>         symbol tag: t
>         FAILED as dr address is invariant
>

I'm thinking that it is not really difficult to consider these scalars
as arrays with a single element, and then just pass these to the rest
of data deps.  I'll try to figure out a patch for this problem that would
bring us more vectorized cases.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33245

Reply via email to