[Patch 2/4] Hack out a use of MOVE_RATIO in tree-inline.c

James Greenhalgh james.greenhalgh@arm.com
Thu Sep 25 14:58:00 GMT 2014


Hi,

This patch hookizes the use of MOVE_RATIO in
tree-inline.c:estimate_move_cost as TARGET_ESTIMATE_BLOCK_COPY_NINSNS.
This hook should return an estimate for the number of instructions
which will be emitted to copy a block of memory.

tree-inline.c uses this in inlining heuristics to estimate the cost of
moving an object. The implementation is lacking, and will likely
underestimate the size of most copies.

An initial iteration of this patch migrated tree-inline.c to use
move_by_pieces_profitable_p and move_by_pieces_ninsns, but this
proved painful for performance on ARM.

This patch puts the control in the hands of the backend, and uses
the existing logic as a default.

Bootstrapped on x86_64, ARM, AArch64.

Ok?

Thanks,
James

---
2014-09-25  James Greenhalgh  <james.greenhalgh@arm.com>

	* target.def (estimate_block_copy_ninsns): New.
	* targhooks.h (default_estimate_block_copy_ninsns): New.
	* targhooks.c (default_estimate_block_copy_ninsns): New.
	* tree-inline.c (estimate_move_cost): Use new target hook.
	* doc/tm.texi.in (TARGET_ESTIMATE_BLOCK_COPY_NINSNS): New.
	* doc/tm.texi: Regenerate.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Patch-2-4-Hack-out-a-use-of-MOVE_RATIO-in-tree-inlin.patch
Type: text/x-patch
Size: 4584 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20140925/951adc13/attachment.bin>


More information about the Gcc-patches mailing list