diff options
| author | Andre Vieira <andre.simoesdiasvieira@arm.com> | 2021-12-02 14:34:15 +0000 |
|---|---|---|
| committer | Andre Vieira <andre.simoesdiasvieira@arm.com> | 2022-01-10 17:54:33 +0000 |
| commit | d3ff7420e941931d32ce2e332e7968fe67ba20af (patch) | |
| tree | 14dc5d0f7401326cf19569ccfa92dc0841a4ac0c /gcc/genopinit.c | |
| parent | 828474fafd2ed33430172fe227f9da7d6fb98723 (diff) | |
| download | gcc-d3ff7420e941931d32ce2e332e7968fe67ba20af.zip gcc-d3ff7420e941931d32ce2e332e7968fe67ba20af.tar.gz gcc-d3ff7420e941931d32ce2e332e7968fe67ba20af.tar.bz2 | |
[vect] Re-analyze all modes for epilogues
gcc/ChangeLog:
* tree-vectorizer.c (better_epilogue_loop_than_p): Round factors up for
epilogue costing.
* tree-vect-loop.c (vect_analyze_loop): Re-analyze all modes for
epilogues, unless we are guaranteed that we can't have partial vectors.
* genopinit.c: (partial_vectors_supported): Generate new function.
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/masked_epilogue.c: New test.
Diffstat (limited to 'gcc/genopinit.c')
| -rw-r--r-- | gcc/genopinit.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/genopinit.c b/gcc/genopinit.c index c5cda28..fe0791c 100644 --- a/gcc/genopinit.c +++ b/gcc/genopinit.c @@ -320,6 +320,7 @@ main (int argc, const char **argv) " signed char supports_vec_scatter_store[NUM_MACHINE_MODES];\n" "};\n" "extern void init_all_optabs (struct target_optabs *);\n" + "extern bool partial_vectors_supported_p (void);\n" "\n" "extern struct target_optabs default_target_optabs;\n" "extern struct target_optabs *this_fn_optabs;\n" @@ -372,6 +373,33 @@ main (int argc, const char **argv) fprintf (s_file, " ena[%u] = HAVE_%s;\n", i, p->name); fprintf (s_file, "}\n\n"); + fprintf (s_file, + "/* Returns TRUE if the target supports any of the partial vector\n" + " optabs: while_ult_optab, len_load_optab or len_store_optab,\n" + " for any mode. */\n" + "bool\npartial_vectors_supported_p (void)\n{\n"); + bool any_match = false; + fprintf (s_file, "\treturn"); + bool first = true; + for (i = 0; patterns.iterate (i, &p); ++i) + { +#define CMP_NAME(N) !strncmp (p->name, (N), strlen ((N))) + if (CMP_NAME("while_ult") || CMP_NAME ("len_load") + || CMP_NAME ("len_store")) + { + if (first) + fprintf (s_file, " HAVE_%s", p->name); + else + fprintf (s_file, " || HAVE_%s", p->name); + first = false; + any_match = true; + } + } + if (!any_match) + fprintf (s_file, " false"); + fprintf (s_file, ";\n}\n"); + + /* Perform a binary search on a pre-encoded optab+mode*2. */ /* ??? Perhaps even better to generate a minimal perfect hash. Using gperf directly is awkward since it's so geared to working |
