[PATCH] split loop for NE condition.

2021-04-29 Thread Jiufu Guo via Gcc-patches
When there is the possibility that overflow may happen on the loop index, a few optimizations would not happen. For example code: foo (int *a, int *b, unsigned k, unsigned n) { while (++k != n) a[k] = b[k] + 1; } For this code, if "l > n", overflow may happen. if "l < n" at begining, it c

Re: [PATCH] split loop for NE condition.

2021-04-30 Thread Jeff Law via Gcc-patches
On 4/29/2021 3:50 AM, Jiufu Guo via Gcc-patches wrote: When there is the possibility that overflow may happen on the loop index, a few optimizations would not happen. For example code: foo (int *a, int *b, unsigned k, unsigned n) { while (++k != n) a[k] = b[k] + 1; } For this code, i

Re: [PATCH] split loop for NE condition.

2021-04-30 Thread Segher Boessenkool
Hi! On Thu, Apr 29, 2021 at 05:50:48PM +0800, Jiufu Guo wrote: > When there is the possibility that overflow may happen on the loop index, > a few optimizations would not happen. For example code: > > foo (int *a, int *b, unsigned k, unsigned n) > { > while (++k != n) > a[k] = b[k] + 1; >

Re: [PATCH] split loop for NE condition.

2021-05-03 Thread Richard Biener
On Thu, 29 Apr 2021, Jiufu Guo wrote: > When there is the possibility that overflow may happen on the loop index, > a few optimizations would not happen. For example code: > > foo (int *a, int *b, unsigned k, unsigned n) > { > while (++k != n) > a[k] = b[k] + 1; > } > > For this code, if

Re: [PATCH] split loop for NE condition.

2021-05-05 Thread guojiufu via Gcc-patches
On 2021-05-01 00:27, Jeff Law wrote: On 4/29/2021 3:50 AM, Jiufu Guo via Gcc-patches wrote: When there is the possibility that overflow may happen on the loop index, a few optimizations would not happen. For example code: foo (int *a, int *b, unsigned k, unsigned n) { while (++k != n)

Re: [PATCH] split loop for NE condition.

2021-05-05 Thread guojiufu via Gcc-patches
On 2021-05-01 05:37, Segher Boessenkool wrote: Hi! On Thu, Apr 29, 2021 at 05:50:48PM +0800, Jiufu Guo wrote: When there is the possibility that overflow may happen on the loop index, a few optimizations would not happen. For example code: foo (int *a, int *b, unsigned k, unsigned n) { whil

Re: [PATCH] split loop for NE condition.

2021-05-06 Thread guojiufu via Gcc-patches
On 2021-05-03 20:18, Richard Biener wrote: On Thu, 29 Apr 2021, Jiufu Guo wrote: When there is the possibility that overflow may happen on the loop index, a few optimizations would not happen. For example code: foo (int *a, int *b, unsigned k, unsigned n) { while (++k != n) a[k] = b[k]

Re: [PATCH] split loop for NE condition.

2021-05-06 Thread Richard Biener
On Thu, 6 May 2021, guojiufu wrote: > On 2021-05-03 20:18, Richard Biener wrote: > > On Thu, 29 Apr 2021, Jiufu Guo wrote: > > > >> When there is the possibility that overflow may happen on the loop index, > >> a few optimizations would not happen. For example code: > >> > >> foo (int *a, int *b

Re: [PATCH] split loop for NE condition.

2021-05-07 Thread guojiufu via Gcc-patches
On 2021-05-06 16:27, Richard Biener wrote: On Thu, 6 May 2021, guojiufu wrote: On 2021-05-03 20:18, Richard Biener wrote: > On Thu, 29 Apr 2021, Jiufu Guo wrote: > >> When there is the possibility that overflow may happen on the loop index, >> a few optimizations would not happen. For example c

Re: [PATCH] split loop for NE condition.

2021-05-07 Thread Richard Biener
On Fri, 7 May 2021, guojiufu wrote: > On 2021-05-06 16:27, Richard Biener wrote: > > On Thu, 6 May 2021, guojiufu wrote: > > > >> On 2021-05-03 20:18, Richard Biener wrote: > >> > On Thu, 29 Apr 2021, Jiufu Guo wrote: > >> > > >> >> When there is the possibility that overflow may happen on the lo