Hi, On Mon, 9 Dec 2019 at 11:23, Sudakshina Das <sudi....@arm.com> wrote: > > Hi Jeff > > On 07/12/2019 17:44, Jeff Law wrote: > > On Fri, 2019-12-06 at 14:05 +0000, Sudakshina Das wrote: > >> Hi > >> > >> While looking at the vectorization for following example, we > >> realized > >> that even though vectorizable_shift function was distinguishing > >> vector > >> shifted by vector from vector shifted by scalar, while modeling the > >> cost > >> it would always add the cost of building a vector constant despite > >> not > >> needing it for vector shifted by scalar. > >> > >> This patch fixes this by using scalar_shift_arg to determine whether > >> we > >> need to build a vector for the second operand or not. This reduces > >> prologue cost as shown in the test. > >> > >> Build and regression tests pass on aarch64-none-elf and > >> x86_64-pc-linux-gnu-gcc. This gives a 3.42% boost to 525.x264_r in > >> Spec2017 for AArch64. > >>
Looks like you didn't check on arm, where I can see that the new testcase fails: FAIL: gcc.dg/vect/vect-shift-5.c -flto -ffat-lto-objects scan-tree-dump vect "vectorizable_shift ===[\\n\\r][^\\n]*prologue_cost = 0" FAIL: gcc.dg/vect/vect-shift-5.c scan-tree-dump vect "vectorizable_shift ===[\\n\\r][^\\n]*prologue_cost = 0" Seen on arm-none-linux-gnueabihf --with-mode arm --with-cpu cortex-a9 --with-fpu neon-fp16 Christophe > >> gcc/ChangeLog: > >> > >> 2019-xx-xx Sudakshina Das <sudi....@arm.com> > >> Richard Sandiford <richard.sandif...@arm.com> > >> > >> * tree-vect-stmt.c (vectorizable_shift): Condition ndts for > >> vect_model_simple_cost call on scalar_shift_arg. > >> > >> gcc/testsuite/ChangeLog: > >> > >> 2019-xx-xx Sudakshina Das <sudi....@arm.com> > >> > >> * gcc.dg/vect/vect-shift-5.c: New test. > > It's a bit borderline, but it's really just twiddling a cost, so OK. > > Thanks :) Committed as r279114. > > Sudi > > > > > jeff > > >