This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH 2/5] [amdgcn] Reinitialize registers for every function
- From: Kwok Cheung Yeung <kcy at codesourcery dot com>
- To: <gcc-patches at gcc dot gnu dot org>, Andrew Stubbs <ams at codesourcery dot com>, Julian Brown <julian at codesourcery dot com>
- Date: Thu, 14 Nov 2019 15:30:48 +0000
- Subject: [PATCH 2/5] [amdgcn] Reinitialize registers for every function
- Ironport-sdr: 7wYyrZSNA6j7MetQ1SlBQ4RsB3ejdM+rElW5sOUOnZcczCEfUecFcfo3KHmJie2HUR+fsvStMu lp5GZL7xuS2MubrGT4IYMHrXKMChI9h3GUxOeqpUkZLpNb45pfqwGkdNoAQTDRpozQ8HYRxFlN L7ersjGhsmgXyyHw0YLaYve1vIcCBSJZD29ujmTT25b+WWhyJTE/k6Vu5YsLrX6UDJetK9AOnT YQ1BaufxC4qSRDG/ETLfdg/s8Dh+dVBtLn2yqwvKDIK+IPwvGFC4tDPu9Fzrj+MIqYaQifHjQg /6Y=
- Ironport-sdr: WDaSN72jaeoENinZJImHlfF/T3h3m+TMPI4q3JQq5BEYg9bDZnMe9vuTHngNaXgY3EwnvaqnDR IO1ymkN+jV044uPOnPlUBtJlDOUzfJurkUce0cBWzfuWZRB4MAXTxpSK2lWNwXqTgwAF+r7quu WlEBbuXqcdGmOEI/5orwpb1djGvuHPRVWarWFFOGORvO5d542aKK6MylvZ6k3wVnHNOu3+Str/ NPU0oPkWeYK+bwbNR5UWfHypuiOeX0mnoSB4HC6w4kRi08Ub4MLAzPLL9qjEl5XK+04aPbOtsE fx8=
- References: <0b37b07a-be6c-2ac6-c579-c7a522024419@codesourcery.com>
The set of fixed registers is adjusted by the
TARGET_CONDITIONAL_REGISTER_USAGE hook, but this needs to be done on a
per-function basis, whereas the hook is normally called once during GCC
initialization before any functions have been processed (which means the
majority of the current implementation is actually dead code!). I have
added a call to reinit_regs in gcn_init_cumulative_args to setup the
available registers for each function.
Okay for trunk?
Kwok
2019-11-14 Kwok Cheung Yeung <kcy@codesourcery.com>
gcc/
* config/gcn/gcn.c (gcn_init_cumulative_args): Call reinit_regs.
---
gcc/config/gcn/gcn.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/gcc/config/gcn/gcn.c b/gcc/config/gcn/gcn.c
index 2c08771..09dfabb 100644
--- a/gcc/config/gcn/gcn.c
+++ b/gcc/config/gcn/gcn.c
@@ -2434,6 +2434,8 @@ gcn_init_cumulative_args (CUMULATIVE_ARGS *cum /*
Argument info to init */ ,
cfun->machine->args = cum->args;
if (!caller && cfun->machine->normal_function)
gcn_detect_incoming_pointer_arg (fndecl);
+
+ reinit_regs ();
}
static bool
--
2.8.1