aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2022-09-05 14:14:44 +0100
committerRichard Sandiford <richard.sandiford@arm.com>2022-09-05 14:14:44 +0100
commitd29ecf23f0b046de720a25171c3b3980fa8a0a22 (patch)
tree541d6fdd7d3ef7e918907d13e908803197d3f29c
parent7742b797b3fd7acea28a0a0bff9bbb06e7c2d0ea (diff)
downloadgcc-d29ecf23f0b046de720a25171c3b3980fa8a0a22.zip
gcc-d29ecf23f0b046de720a25171c3b3980fa8a0a22.tar.gz
gcc-d29ecf23f0b046de720a25171c3b3980fa8a0a22.tar.bz2
aarch64: Remove lazy SIMD builtin initialisation
At one time the aarch64 port registered the Advanced SIMD builtins lazily, when we first encountered a set of target flags that includes +simd. These days we always initialise them at start-up, temporarily forcing a conducive set of flags if necessary. This patch removes some vestiges of the old way of doing things. gcc/ * config/aarch64/aarch64-protos.h (aarch64_init_simd_builtins): Remove prototype. * config/aarch64/aarch64-builtins.cc (aarch64_simd_builtins_initialized_p): Delete. (aarch64_init_simd_builtins): Make static. Remove protection against multiple calls. * config/aarch64/aarch64-c.cc (aarch64_pragma_target_parse): Remove lazy SIMD builtin initialization. * config/aarch64/aarch64.cc (aarch64_option_valid_attribute_p): Likewise.
-rw-r--r--gcc/config/aarch64/aarch64-builtins.cc9
-rw-r--r--gcc/config/aarch64/aarch64-c.cc13
-rw-r--r--gcc/config/aarch64/aarch64-protos.h1
-rw-r--r--gcc/config/aarch64/aarch64.cc12
4 files changed, 1 insertions, 34 deletions
diff --git a/gcc/config/aarch64/aarch64-builtins.cc b/gcc/config/aarch64/aarch64-builtins.cc
index f90fda4..5eef5aa 100644
--- a/gcc/config/aarch64/aarch64-builtins.cc
+++ b/gcc/config/aarch64/aarch64-builtins.cc
@@ -1300,8 +1300,6 @@ aarch64_get_attributes (unsigned int f, machine_mode mode)
return aarch64_add_attribute ("leaf", attrs);
}
-static bool aarch64_simd_builtins_initialized_p = false;
-
/* Due to the architecture not providing lane variant of the lane instructions
for fcmla we can't use the standard simd builtin expansion code, but we
still want the majority of the validation that would normally be done. */
@@ -1586,14 +1584,9 @@ handle_arm_neon_h (void)
aarch64_init_simd_intrinsics ();
}
-void
+static void
aarch64_init_simd_builtins (void)
{
- if (aarch64_simd_builtins_initialized_p)
- return;
-
- aarch64_simd_builtins_initialized_p = true;
-
aarch64_init_simd_builtin_types ();
/* Strong-typing hasn't been implemented for all AdvSIMD builtin intrinsics.
diff --git a/gcc/config/aarch64/aarch64-c.cc b/gcc/config/aarch64/aarch64-c.cc
index 3d2fb5e..52ed4a2 100644
--- a/gcc/config/aarch64/aarch64-c.cc
+++ b/gcc/config/aarch64/aarch64-c.cc
@@ -270,19 +270,6 @@ aarch64_pragma_target_parse (tree args, tree pop_target)
if (pop_target)
aarch64_save_restore_target_globals (pop_target);
- /* Initialize SIMD builtins if we haven't already.
- Set current_target_pragma to NULL for the duration so that
- the builtin initialization code doesn't try to tag the functions
- being built with the attributes specified by any current pragma, thus
- going into an infinite recursion. */
- if (TARGET_SIMD)
- {
- tree saved_current_target_pragma = current_target_pragma;
- current_target_pragma = NULL;
- aarch64_init_simd_builtins ();
- current_target_pragma = saved_current_target_pragma;
- }
-
return true;
}
diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch64-protos.h
index 99af10a..5ecdb8a 100644
--- a/gcc/config/aarch64/aarch64-protos.h
+++ b/gcc/config/aarch64/aarch64-protos.h
@@ -907,7 +907,6 @@ void aarch64_sve_expand_vector_init (rtx, rtx);
void aarch64_init_cumulative_args (CUMULATIVE_ARGS *, const_tree, rtx,
const_tree, unsigned, bool = false);
void aarch64_init_expanders (void);
-void aarch64_init_simd_builtins (void);
void aarch64_emit_call_insn (rtx);
void aarch64_register_pragmas (void);
void aarch64_relayout_simd_types (void);
diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc
index b12f13f..2311ad0 100644
--- a/gcc/config/aarch64/aarch64.cc
+++ b/gcc/config/aarch64/aarch64.cc
@@ -18898,18 +18898,6 @@ aarch64_option_valid_attribute_p (tree fndecl, tree, tree args, int)
if (ret)
{
aarch64_override_options_internal (&global_options);
- /* Initialize SIMD builtins if we haven't already.
- Set current_target_pragma to NULL for the duration so that
- the builtin initialization code doesn't try to tag the functions
- being built with the attributes specified by any current pragma, thus
- going into an infinite recursion. */
- if (TARGET_SIMD)
- {
- tree saved_current_target_pragma = current_target_pragma;
- current_target_pragma = NULL;
- aarch64_init_simd_builtins ();
- current_target_pragma = saved_current_target_pragma;
- }
new_target = build_target_option_node (&global_options,
&global_options_set);
}