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

            Bug ID: 116365
           Summary: Add user-friendly arguments to --param
                    aarch64-autovec-preference=N
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Keywords: easyhack
          Severity: enhancement
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ktkachov at gcc dot gnu.org
  Target Milestone: ---
            Target: aarch64

The param aarch64-autovec-preference=N is a very useful tool for testing
auto-vectorisation in GCC as it allows the user to force a particular strategy.
N can be any of:

0: Use default heuristics:
1: Use only Advanced SIMD (Neon) for auto-vectorisation
2: Use only SVE for auto-vectorisation
3: Use both Neon and SVE but prefer Neon when the costs are equal
4: Use both Neon and SVE but prefer SVE when the costs are equal.
We should add more user-friendly names to distinguish these options. Currently
the param is defined as a UInteger in aarch64.opt. I propose we make it an
Enum, similar to the aarch64-ldp-policy= param and have it accept a finite set
of Enum values that can be named something like: "default", "asimd-only",
"sve-only", "prefer-asimd", "prefer-sve".

For the user, instead of specifying --param aarch64-autovec-preference=2, they
could write --param aarch64-autovec-preference=sve-only .

For backwards compatibility we'll want to retain the numerical values that are
there (they can be made Enum values too) but they should be made aliases of the
new user-readable strings.

The documentation for the param in doc/invoke.texi should be updated and simple
tests in gcc.target/aarch64/ should be added to validate that the strings are
accepted

Reply via email to