Re: [PATCH][gimple-interchange] Add reduction validity check

2017-12-05 Thread Richard Biener
On Mon, 4 Dec 2017, Richard Biener wrote: > On Mon, 4 Dec 2017, Bin.Cheng wrote: > > > On Mon, Dec 4, 2017 at 1:11 PM, Richard Biener wrote: > > > > > > I've noticed we perform FP reduction association without the required > > > checks for associative math. I've added > > > gcc.dg/tree-ssa/loop

Re: [PATCH][gimple-interchange] Add reduction validity check

2017-12-04 Thread Bin.Cheng
On Mon, Dec 4, 2017 at 1:11 PM, Richard Biener wrote: > > I've noticed we perform FP reduction association without the required > checks for associative math. I've added > gcc.dg/tree-ssa/loop-interchange-1b.c to cover this. > > I also noticed we happily interchange a loop with a reduction like >

Re: [PATCH][gimple-interchange] Add reduction validity check

2017-12-04 Thread Richard Biener
On Mon, 4 Dec 2017, Bin.Cheng wrote: > On Mon, Dec 4, 2017 at 1:11 PM, Richard Biener wrote: > > > > I've noticed we perform FP reduction association without the required > > checks for associative math. I've added > > gcc.dg/tree-ssa/loop-interchange-1b.c to cover this. > > > > I also noticed w

Re: [PATCH][gimple-interchange] Add reduction validity check

2017-12-04 Thread Bin.Cheng
On Mon, Dec 4, 2017 at 1:11 PM, Richard Biener wrote: > > I've noticed we perform FP reduction association without the required > checks for associative math. I've added > gcc.dg/tree-ssa/loop-interchange-1b.c to cover this. > > I also noticed we happily interchange a loop with a reduction like >

[PATCH][gimple-interchange] Add reduction validity check

2017-12-04 Thread Richard Biener
I've noticed we perform FP reduction association without the required checks for associative math. I've added gcc.dg/tree-ssa/loop-interchange-1b.c to cover this. I also noticed we happily interchange a loop with a reduction like sum = a[i] - sum; where a change in order of elements isn't ok