public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/98137] New: Could use SLP to vectorize if split_constant_offset were smarter
@ 2020-12-04  9:48 rguenth at gcc dot gnu.org
  2020-12-04 10:05 ` [Bug tree-optimization/98137] " rguenth at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-12-04  9:48 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98137
           Summary: Could use SLP to vectorize if split_constant_offset
                    were smarter
           Product: gcc
           Version: 11.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: ---

void
gemm_m10_n9_k17_ldA20_ldB20_ldC10_beta0_alignedA1_alignedC1_pfsigonly(const
double* __restrict__ A, const double* __restrict__ B, double* __restrict__ C,
const double* A_prefetch, const double* B_prefetch, const double* C_prefetch) {

  unsigned int l_m = 0;
  unsigned int l_n = 0;
  unsigned int l_k = 0;

  for ( l_n = 0; l_n < 9; l_n++ ) {
    for ( l_m = 0; l_m < 10; l_m++ ) { C[(l_n*10)+l_m] = 0.0; }

    for ( l_k = 0; l_k < 17; l_k++ ) {
      for ( l_m = 0; l_m < 10; l_m++ ) {
        C[(l_n*10)+l_m] += A[(l_k*20)+l_m] * B[(l_n*20)+l_k];
      }
    }
  }
}

is nicely vectorized with BB SLP when you make l_{m,n,k} signed but when
unsigned as above then split_constant_offset gives up when seeing

C + ((unsigned long)(_286 + 1) * 8)

but we even have nice range-info:

  # RANGE [0, 80] NONZERO 126
  _286 = l_n_189 * 10;
  # RANGE [0, 80] NONZERO 126
  _288 = (long unsigned int) _286;
  # RANGE [0, 640] NONZERO 1008
  _289 = _288 * 8;
  # PT = null { D.2428 } (nonlocal, restrict)
  _290 = C_37(D) + _289;

^^ C + ((unsigned long)(_286) * 8)

  # RANGE [1, 81] NONZERO 127
  _296 = _286 + 1;
  # RANGE [1, 81] NONZERO 127
  _297 = (long unsigned int) _296;
  # RANGE [8, 648] NONZERO 1016
  _298 = _297 * 8;
  # PT = { D.2428 } (nonlocal, restrict)
  _299 = C_37(D) + _298;

^^ C + ((unsigned long)(_286 + 1) * 8

giving up means DR group analysis doesn't relate them and we do not consider
SLP vectorization.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-12-16  9:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-04  9:48 [Bug tree-optimization/98137] New: Could use SLP to vectorize if split_constant_offset were smarter rguenth at gcc dot gnu.org
2020-12-04 10:05 ` [Bug tree-optimization/98137] " rguenth at gcc dot gnu.org
2020-12-04 10:18 ` rguenth at gcc dot gnu.org
2020-12-07  7:15 ` cvs-commit at gcc dot gnu.org
2020-12-07  7:15 ` rguenth at gcc dot gnu.org
2020-12-16  9:14 ` 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).