This is the mail archive of the
mailing list for the GCC project.
Re: [lra] Cleanup the use of offmemok and don't count spilling cost for it
- From: Jiong Wang <jiong dot wang at foss dot arm dot com>
- To: Vladimir Makarov <vmakarov at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Cc: Andreas Krebbel <krebbel at linux dot vnet dot ibm dot com>, vogt at linux dot vnet dot ibm dot com, Jeff Law <law at redhat dot com>, Robin Dapp <rdapp at linux dot vnet dot ibm dot com>, Bernd Schmidt <bschmidt at redhat dot com>
- Date: Tue, 5 Jul 2016 17:09:45 +0100
- Subject: Re: [lra] Cleanup the use of offmemok and don't count spilling cost for it
- Authentication-results: sourceware.org; auth=none
- References: <email@example.com> <firstname.lastname@example.org> <20160627162614.GA30612@linux.vnet.ibm.com> <email@example.com> <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org> <577ABC99.email@example.com>
On 04/07/16 20:44, Vladimir Makarov wrote:
On 06/30/2016 01:22 PM, Jiong Wang wrote:
Here is the patch,
From my understanding, "offmemok" is used to represent a memory operand
who's address we want to reload, and searching of it's reference location
seems confirmed my understanding as it's always used together with MEM_P check.
So this patch does the following modifications:
* Only set offmemok to true if MEM_P is also true, as otherwise offmemok
is not used.
* Remove redundant MEM_P check which was used together with offmemok.
* Avoid the addition of spilling cost if offmemok be true as an address
calculation reload is not spilling.
bootstrap & gcc/g++ regression OK on x86_64/aarch64/arm.
OK for trunk?
Yes. The patch looks OK to me. Thank you for working on the
solution, Jiong. As I wrote the code is very sensitive and any its
change might affect some targets. Usually patches for this part of
LRA can take a few iterations.
Thanks for the review Vlad.
As Bernd has concerns on merging MEM_P into offmemok. I committed the
following patch as r238010 which keeps the functional change but without
2016-07-05 Jiong Wang<firstname.lastname@example.org>
* lra-constraints.c (process_alt_operands): Don't add spilling cost
diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c
index bf08dce..e9d3e43 100644
@@ -2488,7 +2488,9 @@ process_alt_operands (int only_alternative)
Code below increases the reject for both pseudo and non-pseudo
- if (no_regs_p && !(REG_P (op) && hard_regno[nop] < 0))
+ if (no_regs_p
+ && !(MEM_P (op) && offmemok)
+ && !(REG_P (op) && hard_regno[nop] < 0))
if (lra_dump_file != NULL)