On Wed, Aug 10, 2016 at 6:01 PM, Bin Cheng <bin.ch...@arm.com> wrote: > Hi, > This patch fixes the inefficient code generated by vectorizer as reported by > PR69848. > It introduces new conditional reduction type CONST_COND_REDUCTION. As a > result, > we don't need to compute index vector in loop; also the epilog reduction code > can be > simplified using single reduc_max/reduc_min operation. Together with AArch64 > vcond > patches, the # of insns in loop body is reduced from 10 to 4 on AArch64. > Note, this one > doesn't handle cases in which reduction values are loop invariants because it > requires > quite different code to current implementation, and I failed to work out a > "clean" patch at > the moment. > > Bootstrap and test on x86_64 and AArch64. Is it OK?
Ok. Thanks, Richard. > Thanks, > bin > > 2016-08-08 Bin Cheng <bin.ch...@arm.com> > > PR tree-optimization/69848 > * tree-vectorizer.h (enum vect_def_type): New condition reduction > type CONST_COND_REDUCTION. > * tree-vect-loop.c (vectorizable_reduction): Support new condition > reudction type CONST_COND_REDUCTION. > > gcc/testsuite/ChangeLog > 2016-08-08 Bin Cheng <bin.ch...@arm.com> > > PR tree-optimization/69848 > * gcc.dg/vect/vect-pr69848.c: New test.