On Thu, Jul 17, 2014 at 11:07 AM, Bin Cheng <bin.ch...@arm.com> wrote: > Hi, > This is a series of three patches improving induction variable elimination. > Currently GCC only eliminates iv for very specific case when the loop’s > latch could run zero times, i.e., when may_be_zero field of loop niter > information evaluates to true. In fact, it’s so specific that > iv_elimination_compare_lt rarely succeeds during either GCC bootstrap or > spec2000/spec2006 compilation. Though intrusive data shows these patches > don’t help iv elimination that much for GCC bootstrap, they do capture > 5%~15% more eliminations for compiling spec2000/2006. Detailed numbers are > like: > 2k/int 2k/fp 2k6/int 2k6/fp > improve ~9.6% ~4.8% ~5.5% ~14.4% > > All patches pass bootstrap and regression test on x86_64/x86. I will > bootstrap and test them on aarch64/arm platforms too. > > The first patch turns to tree operand_equal_p to check the number of > iterations in iv_elimination_lt. Though I think this change isn’t necessary > for current code, it’s needed if we further relax iv elimination for cases > in which sign/unsigned conversion is involved.
As said elsewhere this bug should be fixed in tree-affine.c. Do you have a testcase? Thanks, Richard. > Thanks, > bin > > 2014-07-17 Bin Cheng <bin.ch...@arm.com> > > * tree-ssa-loop-ivopts.c (iv_elimination_compare_lt): Check number > of iteration using tree comparison.