[Bug tree-optimization/102905] [12 regression] several vector test cases fail on power 7 after r12-4490

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Oct 25 09:33:05 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102905

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Hmm, so with a cc1 cross to powerpc64-linux and -mcpu=power7 I do see the
correct things in the dump files (but not without -mcpu=power7).  Similar
behavior
is for -mvsx vs. -mno-vsx (where it also reproduces on ppc64le)

In the failing case we ask the target

rs6000_builtin_support_vector_misalignment (mode=E_V4SImode, 
    type=<integer_type 0x7ffff6546738 int>, misalignment=8, is_packed=false)

(that's the store)

but w/o TARGET_VSX that function simply returns false.

The source of the testcase (vect-peel-1.c) specifically says

  /* All the accesses are misaligned. With cost model disabled, we
     count the number of aligned accesses for each peeling option, and
     in this case we align the two loads if possible (i.e., if
     misaligned stores are supported).  */
  for (i = 1; i <= N; i++)
    {
      ia[i] = ib[i+2] + ib[i+6];

and that's what seems to happen.  But then the testcase has

/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect"
{ target { { vect_element_align } && { vect_aligned_arrays } } xfail { !
vect_unaligned_possible } } } } */
/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling"
1 "vect" { xfail vect_element_align_preferred } } } */

so it expects to peel, vectorize the loop but also not vectorize an unaligned
accesss?

Ah, so before the change we peeled 3 iterations, aligning the store which
means we were able to use re-aligning loads.  But now we are peeling 1
iteration to align the loads (as the testcase expected).

And the key difference is that we're now invoking the target hook to tell
whether vect_peeling_hash_insert should boost the entry but formerly
we used vect_supportable_dr_alignment which had the re-align load path.
But after later refactoring we can now again easily use
vect_supportable_dr_alignment here.


More information about the Gcc-bugs mailing list