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

            Bug ID: 127723
           Summary: [vectorizer] Handle simdlen's 'scaled' modifier of
                    OpenMP 'simd' / __simd__ attr for non-const simdlen
                    AArch64/RISC-V(AArch64/RISC-V)
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Keywords: aarch64-sve, missed-optimization, openmp
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
                CC: rdapp at gcc dot gnu.org, tnfchris at gcc dot gnu.org
            Blocks: 53947, 119187
  Target Milestone: ---

OpenMP since Technical Report 14 (TR14), to be released as part of OpenMP 6.1
(due Nov 2026) extended simdlen, https://www.openmp.org/specifications/ (→
"18.5.3 simdlen Clause" in TR15 / OpenMP 6.1).
[Non-public OpenMP spec issue #3587]

Reason for the extension: For AArch64/RISC-V, declare simd/declare variant,
simd traits with non-constant simdlen would be useful.

Added was the 'scaled' modifier, to be used as:

.... simd(simdlen(scaled(int):1)

both in 'declare simd' and in 'omp simd' directly; additionally, there is
also the __simd__ attribute.

* * *

>From the spec:

scaled-modifier

Modifies:
  length

Type:
  Complex, name: 'scaled'

  Arguments:
  _type_ – type name
  _divisor_ expression of integer type (constant, positive, optional)


If the scaled-modifier is present, the preferred number of collapsed
iterations or the number of concurrent arguments is given by the
length argument multiplied by a scaling factor that is computed as follows.

Let  V L(type)  be an implementation defined value, possibly determined at
runtime, equal to some number of SIMD lanes that can be used to process type
data elements in parallel, and let d be the value of divisor, if specified,
and otherwise one. The scaling factor is then  equal to max(1, ⌊V L(type)/dāŒ‹).

* [C/C++] In a scaled-modifier, type must be an arithmetic type.
* [Fortran] In a scaled-modifier, type must be a numeric intrinsic type.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53947
[Bug 53947] [meta-bug] vectorizer missed-optimizations
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119187
[Bug 119187] vectorizer should be able to SLP already vectorized code

Reply via email to