@@ -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"
From: Cesar Philippidis <cesar@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 <cltang@codesourcery.com> Cesar Philippidis <cesar@codesourcery.com gcc/ config/nvptx/nvptx.c (nvptx_previous_fndecl): Declare. (nvptx_set_current_function): New function. (TARGET_SET_CURRENT_FUNCTION): Define.