On Thu, Jun 30, 2011 at 8:24 AM, Richard Guenther <rguent...@suse.de> wrote: > On Wed, 29 Jun 2011, Richard Guenther wrote: > >> >> The following patch makes us handle invariant loads during vectorization. >> Dependence analysis currently isn't clever enough to disambiguate them >> thus we insert versioning-for-alias checks. For the testcase hoisting >> the load is still always possible though, and for a read-after-write >> dependence it would be possible for the vectorized loop copy as the >> may-aliasing write is varying by the scalar variable size. >> >> The existing code for vectorizing invariant accesses looks very >> suspicious - it generates a vector load at the scalar address >> to then just extract the first vector element. Huh. IMHO this >> can be simplified as done, by just re-using the scalar load result. >> But maybe this code was supposed to deal with something entirely >> different? >> >> This patch gives a 33% speedup to the phoronix himeno testcase >> if you bump the maximum alias versioning checks we want to insert. >> >> I'm currently re-bootstrapping & testing this but an earlier version >> was ok on x86_64-unknown-linux-gnu. > > FYI, I'm testing the following which cures a fallout seen when > building SPEC2k6 with the committed patch. It's suboptimal for > j != 0 though - is there a way to get to the vectorized stmt > of the j == 0 iteration? > > Thanks, > Richard. > > 2011-06-30 Richard Guenther <rguent...@suse.de> > > * tree-vect-stmts.c (vectorizable_load): Remove unnecessary > assert. >
Will this fix http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49603 -- H.J.