This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Hi,
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.
	(TARGET_VECTORIZE_INIT_COST): New macro.
	(TARGET_VECTORIZE_FINISH_COST): New macro.
	(TARGET_VECTORIZE_DESTROY_COST_DATA): New macro.

Attachment: density-check-on-vect-cost-20161011.txt
Description: density-check-on-vect-cost-20161011.txt


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]