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 GCC 9/9]Prove no-overflow in computation of LOOP_VINFO_NITERS and improve code generation


Hi,
LOOP_VINFO_NITERS is computed as LOOP_VINFO_NITERSM1 + 1, which could overflow in loop niters' type.  Vectorizer needs to generate more code computing vectorized niters if overflow does happen.  However, For common loops, there is no overflow actually, this patch tries to prove the no-overflow information and use that to improve code generation.  At the moment, no-overflow information comes either from loop niter analysis, or the truth that we know loop is peeled for non-zero iterations in prologue peeling.  For the latter case, it doesn't matter if the original LOOP_VINFO_NITERS overflows or not, because computation LOOP_VINFO_NITERS - LOOP_VINFO_PEELING_FOR_ALIGNMENT cancels the overflow by underflow.

Thanks,
bin

2016-09-01  Bin Cheng  <bin.cheng@arm.com>

	* tree-vect-loop.c (loop_niters_no_overflow): New func.
	(vect_transform_loop): Call loop_niters_no_overflow.  Pass the
	no-overflow information to vect_do_peeling_for_loop_bound and
	vect_gen_vector_loop_niters.

Attachment: 009-prove-no_overflow-for-vect-niters-20160902.txt
Description: 009-prove-no_overflow-for-vect-niters-20160902.txt


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