[PATCH PR81913]Skip niter analysis if either IV in exit condition can wrap

Bin Cheng Bin.Cheng@arm.com
Thu Aug 24 11:16:00 GMT 2017


Hi,
I added code handle exit condition like "IV1 le/lt IV2" by changing it into "IV1' le/lt INV".
Unfortunately, wrapping behavior has subtle impact on the transformation.  This patch for
now skips niter analysis if either IV1 or IV2 can wrap.  We can still handle pointer case
as reported in PR81196, but unsigned type needs more work.  The patch also includes two
XFAIL tests showing what shall be improved here.
Bootstrap and test on AArch64.  Is it OK?

Thanks,
bin
2017-08-24  Bin Cheng  <bin.cheng@arm.com>

	PR tree-optimization/81913
	* tree-ssa-loop-niter.c (number_of_iterations_cond): Skip niter
	analysis when either IVs in condition can wrap.

gcc/testsuite
2017-08-24  Bin Cheng  <bin.cheng@arm.com>

	PR tree-optimization/81913
	* gcc.c-torture/execute/pr81913.c: New test.
	* gcc.dg/tree-ssa/loop-niter-1.c: New test.
	* gcc.dg/tree-ssa/loop-niter-2.c: New test.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: pr81913-20170817.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20170824/85b09bce/attachment.txt>


More information about the Gcc-patches mailing list