public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/110222] New: Inefficient fully masked loop vectorization with AVX512
@ 2023-06-12 12:50 rguenth at gcc dot gnu.org
  0 siblings, 0 replies; only message in thread
From: rguenth at gcc dot gnu.org @ 2023-06-12 12:50 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110222
           Summary: Inefficient fully masked loop vectorization with
                    AVX512
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---

gfortran.dg/matmul_2.f90 with -march=znver4 --param vect-partial-vector-usage=2
shows the

  c(:,1:7:2) = matmul(a,b(:,1:7:2))

innermost loop vectorized with

  note:  vectorization_factor = 16, niters = 2

which means a statically known loop mask which is even power-of-two.  This
should be instead vectorized without masking and V2SImode vectors.  Similarly
for a theoretical niters = 3 or a niters < 4 this should use a smaller
(but masked) vector mode for vectorization, not the target preferred 512bit
size.

The x86 target currently chooses to not get costs with different vector modes
compared but in these cases statically selecting a better mode should be
possible.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-06-12 12:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-12 12:50 [Bug tree-optimization/110222] New: Inefficient fully masked loop vectorization with AVX512 rguenth at gcc dot gnu.org

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).