diff options
author | Kyrylo Tkachov <kyrylo.tkachov@arm.com> | 2015-08-04 10:45:48 +0000 |
---|---|---|
committer | Kyrylo Tkachov <ktkachov@gcc.gnu.org> | 2015-08-04 10:45:48 +0000 |
commit | 91d0e8dec9e589701e681ec4357e054fd658c2bb (patch) | |
tree | 9473e9bef2a6c5ba5a6db220edb6b790866c6675 | |
parent | e55edd82da9252f80615fa0912db13fbe295360d (diff) | |
download | gcc-91d0e8dec9e589701e681ec4357e054fd658c2bb.zip gcc-91d0e8dec9e589701e681ec4357e054fd658c2bb.tar.gz gcc-91d0e8dec9e589701e681ec4357e054fd658c2bb.tar.bz2 |
[AArch64][14/14] Reuse target_option_current_node when passing pragma string to target attribute
* config/aarch64/aarch64.c (aarch64_option_valid_attribute_p):
Exit early and use target_option_current_node if processing current
pragma.
From-SVN: r226567
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/aarch64/aarch64.c | 12 |
2 files changed, 18 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 798b11a..a76cf03 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2015-08-04 Kyrylo Tkachov <kyrylo.tkachov@arm.com> + * config/aarch64/aarch64.c (aarch64_option_valid_attribute_p): + Exit early and use target_option_current_node if processing current + pragma. + +2015-08-04 Kyrylo Tkachov <kyrylo.tkachov@arm.com> + * doc/extend.texi (AArch64 Function Attributes): New node. (AArch64 Pragmas): Likewise. diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 63b49ab..ad6c330 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -8414,6 +8414,18 @@ aarch64_option_valid_attribute_p (tree fndecl, tree, tree args, int) tree old_optimize; tree new_target, new_optimize; tree existing_target = DECL_FUNCTION_SPECIFIC_TARGET (fndecl); + + /* If what we're processing is the current pragma string then the + target option node is already stored in target_option_current_node + by aarch64_pragma_target_parse in aarch64-c.c. Use that to avoid + having to re-parse the string. This is especially useful to keep + arm_neon.h compile times down since that header contains a lot + of intrinsics enclosed in pragmas. */ + if (!existing_target && args == current_target_pragma) + { + DECL_FUNCTION_SPECIFIC_TARGET (fndecl) = target_option_current_node; + return true; + } tree func_optimize = DECL_FUNCTION_SPECIFIC_OPTIMIZATION (fndecl); old_optimize = build_optimization_node (&global_options); |