diff options
author | Andre Vieira (lists) <andre.simoesdiasvieira@arm.com> | 2023-12-20 15:17:09 +0000 |
---|---|---|
committer | H.J. Lu <(no_default)> | 2023-12-21 10:36:29 -0800 |
commit | 135bb9e37167ef70501a888bd3db195b11b37ae3 (patch) | |
tree | db196dc578291bf6adf560a2c9f72e4efee8b2ce /gcc | |
parent | 2766b83759a02572b7b303aae3d4b54a351f8f96 (diff) | |
download | gcc-135bb9e37167ef70501a888bd3db195b11b37ae3.zip gcc-135bb9e37167ef70501a888bd3db195b11b37ae3.tar.gz gcc-135bb9e37167ef70501a888bd3db195b11b37ae3.tar.bz2 |
omp: Fix simdclone arguments with veclen lower than simdlen [PR113040]
This patch fixes an issue introduced by:
commit ea4a3d08f11a59319df7b750a955ac613a3f438a
Author: Andre Vieira <andre.simoesdiasvieira@arm.com>
Date: Wed Nov 1 17:02:41 2023 +0000
omp: Reorder call for TARGET_SIMD_CLONE_ADJUST
The problem was that after this patch we no longer added multiple
arguments for vector arguments where the veclen was lower than the simdlen.
Bootstrapped and regression tested on x86_64-pc-linux-gnu and
aarch64-unknown-linux-gnu.
gcc/ChangeLog:
PR middle-end/113040
* omp-simd-clone.cc (simd_clone_adjust_argument_types): Add multiple
vector arguments where simdlen is larger than veclen.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/omp-simd-clone.cc | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/gcc/omp-simd-clone.cc b/gcc/omp-simd-clone.cc index 3fbe428..5151fef 100644 --- a/gcc/omp-simd-clone.cc +++ b/gcc/omp-simd-clone.cc @@ -781,6 +781,7 @@ simd_clone_adjust_argument_types (struct cgraph_node *node) struct cgraph_simd_clone *sc = node->simdclone; unsigned i, k; poly_uint64 veclen; + auto_vec<tree> new_params; for (i = 0; i < sc->nargs; ++i) { @@ -798,9 +799,11 @@ simd_clone_adjust_argument_types (struct cgraph_node *node) switch (sc->args[i].arg_type) { default: + new_params.safe_push (parm_type); break; case SIMD_CLONE_ARG_TYPE_LINEAR_UVAL_CONSTANT_STEP: case SIMD_CLONE_ARG_TYPE_LINEAR_UVAL_VARIABLE_STEP: + new_params.safe_push (parm_type); if (node->definition) sc->args[i].simd_array = create_tmp_simd_array (IDENTIFIER_POINTER (DECL_NAME (parm)), @@ -828,6 +831,9 @@ simd_clone_adjust_argument_types (struct cgraph_node *node) else vtype = build_vector_type (parm_type, veclen); sc->args[i].vector_type = vtype; + k = vector_unroll_factor (sc->simdlen, veclen); + for (unsigned j = 0; j < k; j++) + new_params.safe_push (vtype); if (node->definition) sc->args[i].simd_array @@ -893,22 +899,8 @@ simd_clone_adjust_argument_types (struct cgraph_node *node) last_parm_void = true; gcc_assert (TYPE_ARG_TYPES (TREE_TYPE (node->decl))); - for (i = 0; i < sc->nargs; i++) - { - tree ptype; - switch (sc->args[i].arg_type) - { - default: - ptype = sc->args[i].orig_type; - break; - case SIMD_CLONE_ARG_TYPE_LINEAR_VAL_CONSTANT_STEP: - case SIMD_CLONE_ARG_TYPE_LINEAR_VAL_VARIABLE_STEP: - case SIMD_CLONE_ARG_TYPE_VECTOR: - ptype = sc->args[i].vector_type; - break; - } - new_arg_types = tree_cons (NULL_TREE, ptype, new_arg_types); - } + for (i = 0; i < new_params.length (); i++) + new_arg_types = tree_cons (NULL_TREE, new_params[i], new_arg_types); new_reversed = nreverse (new_arg_types); if (last_parm_void) { |