Re: [PATCH VECT]Swap operands for cond_reduction when necessary

2016-11-01 Thread Bin.Cheng
On Fri, Oct 28, 2016 at 1:38 PM, Richard Biener wrote: > On Wed, Oct 26, 2016 at 6:42 PM, Bin Cheng wrote: >> Hi, >> For stmt defining reduction, GCC vectorizer assumes that the reduction >> variable is always the last (second) operand. Another fact is that >> vectorizer doesn't swap operands

Re: [PATCH VECT]Swap operands for cond_reduction when necessary

2016-10-28 Thread Richard Biener
On Wed, Oct 26, 2016 at 6:42 PM, Bin Cheng wrote: > Hi, > For stmt defining reduction, GCC vectorizer assumes that the reduction > variable is always the last (second) operand. Another fact is that > vectorizer doesn't swap operands for cond_reduction during analysis stage. > The problem is G

[PATCH VECT]Swap operands for cond_reduction when necessary

2016-10-26 Thread Bin Cheng
Hi, For stmt defining reduction, GCC vectorizer assumes that the reduction variable is always the last (second) operand. Another fact is that vectorizer doesn't swap operands for cond_reduction during analysis stage. The problem is GCC middle-end may canonicalize cond_expr into a form that red