public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Patch 0/2 PR78561] Recalculate constant pool size before emitting it
@ 2016-12-01 15:29 James Greenhalgh
  2016-12-01 15:29 ` [Patch 2/2 " James Greenhalgh
  2016-12-01 15:29 ` [Patch 1/2 PR78561] Rename get_pool_size to get_pool_size_upper_bound James Greenhalgh
  0 siblings, 2 replies; 6+ messages in thread
From: James Greenhalgh @ 2016-12-01 15:29 UTC (permalink / raw)
  To: gcc-patches; +Cc: nd

[-- Attachment #1: Type: text/plain, Size: 2496 bytes --]

Hi,

In PR78561, we try to make use of stale constant pool offset data when
making decisions as to whether to output an alignment directive after
the AArch64 constant pool. The offset data goes stale as we only ever
increment it when adding new constants to the pool (it represents an
upper bound on the size of the pool).

To fix that, we should recompute the offset values shortly after
sweeping through insns looking for valid constant.

That's easy enough to do (see patch 2/2) and patch 1/2 is just a simple
rename of the get_pool_size function to reflect that it is not providing
an accurate size, just an upper bound on what the size might be after
optimisation.

Technically, patch 1/2 isn't neccessary to fix the PR but cleaning up the
name seems like a useful to do.

The patch set has been bootstrapped and tested on aarch64-none-linux-gnu and
x86-64-none-linux-gnu without any issues. I've also cross-tested it for
aarch64-none-elf and build-tested it for rs6000 (though I couldn't run the
testsuite as I don't have a test environment).

OK?

Thanks,
James

---

[Patch 1/2 PR78561] Rename get_pool_size to get_pool_size_upper_bound

gcc/

2016-12-01  James Greenhalgh  <james.greenhalgh@arm.com>

	PR rtl-optimization/78561
	* config/rs6000/rs6000.c (rs6000_reg_live_or_pic_offset_p) Rename
	get_pool_size to get_pool_size_upper_bound.
	(rs6000_stack_info): Likewise.
	(rs6000_emit_prologue): Likewise.
	(rs6000_elf_declare_function_name): Likewise.
	(rs6000_set_up_by_prologue): Likewise.
	(rs6000_can_eliminate): Likewise, reformat spaces to tabs.
	* output.h (get_pool_size): Rename to...
	(get_pool_size_upper_bound): ...This.
	* varasm.c (get_pool_size): Rename to...
	(get_pool_size_upper_bound): ...This.

[Patch 2/2 PR78561] Recalculate constant pool size before emitting it

gcc/

2016-12-01  James Greenhalgh  <james.greenhalgh@arm.com>

	PR rtl-optimization/78561
	* varasm.c (recompute_pool_offsets): New.
	(output_constant_pool): Call it.

gcc/testsuite/

2016-12-01  James Greenhalgh  <james.greenhalgh@arm.com>

	PR rtl-optimization/78561
	* gcc.target/aarch64/pr78561.c: New.

---

 gcc/config/rs6000/rs6000.c                 | 23 +++++++++++++----------
 gcc/output.h                               |  7 +++++--
 gcc/testsuite/gcc.target/aarch64/pr78561.c |  9 +++++++++
 gcc/varasm.c                               | 30 +++++++++++++++++++++++++++++-
 4 files changed, 56 insertions(+), 13 deletions(-)
 create mode 100644 gcc/testsuite/gcc.target/aarch64/pr78561.c


^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: [Patch 0/2 PR78561] Recalculate constant pool size before emitting it
@ 2016-12-01 17:55 David Edelsohn
  2016-12-02 14:39 ` James Greenhalgh
  0 siblings, 1 reply; 6+ messages in thread
From: David Edelsohn @ 2016-12-01 17:55 UTC (permalink / raw)
  To: James Greenhalgh; +Cc: nd, GCC Patches, Segher Boessenkool

>>>>> James Greenhalgh writes:

> The patch set has been bootstrapped and tested on aarch64-none-linux-gnu and
> x86-64-none-linux-gnu without any issues. I've also cross-tested it for
> aarch64-none-elf and build-tested it for rs6000 (though I couldn't run the
> testsuite as I don't have a test environment).

There are PPC64 Linux and AIX systems in the GNU Compile Farm.  All
have DejaGNU installed.

- David

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-12-02 14:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-01 15:29 [Patch 0/2 PR78561] Recalculate constant pool size before emitting it James Greenhalgh
2016-12-01 15:29 ` [Patch 2/2 " James Greenhalgh
2016-12-01 15:29 ` [Patch 1/2 PR78561] Rename get_pool_size to get_pool_size_upper_bound James Greenhalgh
2016-12-01 20:44   ` Jeff Law
2016-12-01 17:55 [Patch 0/2 PR78561] Recalculate constant pool size before emitting it David Edelsohn
2016-12-02 14:39 ` James Greenhalgh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).