[PATCH AArch64]Penalize vector cost for large loops with too many vect insns.

Bin Cheng Bin.Cheng@arm.com
Fri Oct 14 13:15:00 GMT 2016

It is suspected that for some large loops with too many vect_insns after vectorization, the performance will be regressed because of various reasons.  Two possible reasons are:
1) Suggested by powerpc backend, large loops with too many vect_insns may jam vector unit's pipeline.
2) Vectorizer may generate bad code, especially if the loop has many different memory accesses.  These memory accesses could refer to different memory objects, or the same object but with different constant offset.  This may result in more base register living from loop preheader, as well as high register pressure.
This patch penalize vector cost for such loops in order to skip vectorizing.  The idea is totally borrowed from powerpc backend.  I adjusted the parameter a bit to get better performance on AArch64.  It improves several cases in spec, especially 459.GemsFDTD by ~15%.

Bootstrap and test on AArch64. Is it OK?

2016-10-13  Bin Cheng  <bin.cheng@arm.com>

	* config/aarch64/aarch64.c (struct aarch64_vect_loop_cost_data): New.
	(aarch64_add_stmt_cost): Use struct aarch64_vect_loop_cost_data.
	(aarch64_init_cost, aarch64_density_test): New funcs.
	(aarch64_finish_cost, aarch64_destroy_cost_data): New funcs.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: density-check-on-vect-cost-20161011.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20161014/9a2fcec1/attachment.txt>

More information about the Gcc-patches mailing list