Commit 43be05f5 by Tom de Vries Committed by Tom de Vries

[nvptx] Use TARGET_SET_CURRENT_FUNCTION

Implement TARGET_SET_CURRENT_FUNCTION for nvptx.  This gives us a place to
add initialization or reset actions that need to be executed on a per-function
basis.

Build and reg-tested on x86_64 with nvptx accelerator.

2018-12-19  Tom de Vries  <tdevries@suse.de>

	* config/nvptx/nvptx.c (nvptx_previous_fndecl): Declare.
	(nvptx_set_current_function): New function.
	(TARGET_SET_CURRENT_FUNCTION): Define.

From-SVN: r267256
parent 5a8d95cc
2018-12-19 Tom de Vries <tdevries@suse.de>
* config/nvptx/nvptx.c (nvptx_previous_fndecl): Declare.
(nvptx_set_current_function): New function.
(TARGET_SET_CURRENT_FUNCTION): Define.
2018-12-19 Shaokun Zhang <zhangshaokun@hisilicon.com>
* config/aarch64/aarch64-cores.def (tsv110): Fix architecture. This
......@@ -5980,6 +5980,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
......@@ -6116,6 +6127,9 @@ nvptx_can_change_mode_class (machine_mode, machine_mode, reg_class_t)
#undef TARGET_HAVE_SPECULATION_SAFE_VALUE
#define TARGET_HAVE_SPECULATION_SAFE_VALUE speculation_safe_value_not_needed
#undef TARGET_SET_CURRENT_FUNCTION
#define TARGET_SET_CURRENT_FUNCTION nvptx_set_current_function
struct gcc_target targetm = TARGET_INITIALIZER;
#include "gt-nvptx.h"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment