mirror of git://gcc.gnu.org/git/gcc.git
[arm] Use ISA feature sets for determining inlinability
Now that we can construct the build target isa from the cl_target_options data we can use this to determine inlinability. This eliminates the final remaining use of the FPU features field. * arm.c (arm_can_inline_p): Use ISA features for determining inlinability. From-SVN: r243714
This commit is contained in:
parent
a53613c4ae
commit
56941f70ee
|
|
@ -1,3 +1,8 @@
|
||||||
|
2016-12-15 Richard Earnshaw <rearnsha@arm.com>
|
||||||
|
|
||||||
|
* arm.c (arm_can_inline_p): Use ISA features for determining
|
||||||
|
inlinability.
|
||||||
|
|
||||||
2016-12-15 Richard Earnshaw <rearnsha@arm.com>
|
2016-12-15 Richard Earnshaw <rearnsha@arm.com>
|
||||||
|
|
||||||
* arm-protos.h (arm_configure_build_target): Change second argument
|
* arm-protos.h (arm_configure_build_target): Change second argument
|
||||||
|
|
|
||||||
|
|
@ -30227,6 +30227,7 @@ arm_can_inline_p (tree caller, tree callee)
|
||||||
{
|
{
|
||||||
tree caller_tree = DECL_FUNCTION_SPECIFIC_TARGET (caller);
|
tree caller_tree = DECL_FUNCTION_SPECIFIC_TARGET (caller);
|
||||||
tree callee_tree = DECL_FUNCTION_SPECIFIC_TARGET (callee);
|
tree callee_tree = DECL_FUNCTION_SPECIFIC_TARGET (callee);
|
||||||
|
bool can_inline = true;
|
||||||
|
|
||||||
struct cl_target_option *caller_opts
|
struct cl_target_option *caller_opts
|
||||||
= TREE_TARGET_OPTION (caller_tree ? caller_tree
|
= TREE_TARGET_OPTION (caller_tree ? caller_tree
|
||||||
|
|
@ -30236,19 +30237,29 @@ arm_can_inline_p (tree caller, tree callee)
|
||||||
= TREE_TARGET_OPTION (callee_tree ? callee_tree
|
= TREE_TARGET_OPTION (callee_tree ? callee_tree
|
||||||
: target_option_default_node);
|
: target_option_default_node);
|
||||||
|
|
||||||
const struct arm_fpu_desc *caller_fpu
|
if (callee_opts == caller_opts)
|
||||||
= &all_fpus[caller_opts->x_arm_fpu_index];
|
return true;
|
||||||
const struct arm_fpu_desc *callee_fpu
|
|
||||||
= &all_fpus[callee_opts->x_arm_fpu_index];
|
|
||||||
|
|
||||||
/* Callee's fpu features should be a subset of the caller's. */
|
/* Callee's ISA features should be a subset of the caller's. */
|
||||||
if ((caller_fpu->features & callee_fpu->features) != callee_fpu->features)
|
struct arm_build_target caller_target;
|
||||||
return false;
|
struct arm_build_target callee_target;
|
||||||
|
caller_target.isa = sbitmap_alloc (isa_num_bits);
|
||||||
|
callee_target.isa = sbitmap_alloc (isa_num_bits);
|
||||||
|
|
||||||
|
arm_configure_build_target (&caller_target, caller_opts, &global_options_set,
|
||||||
|
false);
|
||||||
|
arm_configure_build_target (&callee_target, callee_opts, &global_options_set,
|
||||||
|
false);
|
||||||
|
if (!bitmap_subset_p (callee_target.isa, caller_target.isa))
|
||||||
|
can_inline = false;
|
||||||
|
|
||||||
|
sbitmap_free (caller_target.isa);
|
||||||
|
sbitmap_free (callee_target.isa);
|
||||||
|
|
||||||
/* OK to inline between different modes.
|
/* OK to inline between different modes.
|
||||||
Function with mode specific instructions, e.g using asm,
|
Function with mode specific instructions, e.g using asm,
|
||||||
must be explicitly protected with noinline. */
|
must be explicitly protected with noinline. */
|
||||||
return true;
|
return can_inline;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Hook to fix function's alignment affected by target attribute. */
|
/* Hook to fix function's alignment affected by target attribute. */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue