From: Cesar Philippidis <ce...@codesourcery.com> Chung-Lin had originally defined TARGET_SET_CURRENT_FUNCTION as part of his gang-local variable patch. But I intend to introduce those changes at a later time. Eventually the state propagation code will utilize nvptx_set_current_function to reset the reduction buffer offset. However, for the time being, this patch only introduces it as a placeholder.
2018-XX-YY Chung-Lin Tang <clt...@codesourcery.com> Cesar Philippidis <ce...@codesourcery.com gcc/ config/nvptx/nvptx.c (nvptx_previous_fndecl): Declare. (nvptx_set_current_function): New function. (TARGET_SET_CURRENT_FUNCTION): Define. diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c index e3a02d2..09daedd 100644 --- a/gcc/config/nvptx/nvptx.c +++ b/gcc/config/nvptx/nvptx.c @@ -6012,6 +6012,17 @@ nvptx_can_change_mode_class (machine_mode, machine_mode, reg_class_t) return false; } +static GTY(()) tree nvptx_previous_fndecl; + +static void +nvptx_set_current_function (tree fndecl) +{ + if (!fndecl || fndecl == nvptx_previous_fndecl) + return; + + nvptx_previous_fndecl = fndecl; +} + #undef TARGET_OPTION_OVERRIDE #define TARGET_OPTION_OVERRIDE nvptx_option_override @@ -6145,6 +6156,9 @@ nvptx_can_change_mode_class (machine_mode, machine_mode, reg_class_t) #undef TARGET_CAN_CHANGE_MODE_CLASS #define TARGET_CAN_CHANGE_MODE_CLASS nvptx_can_change_mode_class +#undef TARGET_SET_CURRENT_FUNCTION +#define TARGET_SET_CURRENT_FUNCTION nvptx_set_current_function + struct gcc_target targetm = TARGET_INITIALIZER; #include "gt-nvptx.h" -- 2.7.4