From 91d0e8dec9e589701e681ec4357e054fd658c2bb Mon Sep 17 00:00:00 2001 From: Kyrylo Tkachov Date: Tue, 4 Aug 2015 10:45:48 +0000 Subject: [PATCH] [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 --- gcc/ChangeLog | 6 ++++++ gcc/config/aarch64/aarch64.c | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 798b11af69a..a76cf0380b5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-08-04 Kyrylo Tkachov + + * 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 * doc/extend.texi (AArch64 Function Attributes): New node. diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 63b49ab1721..ad6c330b75e 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); -- 2.30.2