[VectorCombine] forward walk through instructions to improve chaining of transforms
authorSanjay Patel <spatel@rotateright.com>
Sat, 16 May 2020 17:08:01 +0000 (13:08 -0400)
committerSanjay Patel <spatel@rotateright.com>
Sat, 16 May 2020 17:08:01 +0000 (13:08 -0400)
commit81e9ede3a2db32487c15dc20d5d0be6392fb62bc
treef14024845731caadd4c04f2a25e41b6feb295bd6
parent43017ceb7841c7a0700e5401e79c2f1a28caec5e
[VectorCombine] forward walk through instructions to improve chaining of transforms

This is split off from D79799 - where I was proposing to fully iterate
over a function until there are no more transforms. I suspect we are
still going to want to do something like that eventually.

But we can achieve the same gains much more efficiently on the current
set of regression tests just by reversing the order that we visit the
instructions.

This may also reduce the motivation for D79078, but we are still not
getting the optimal pattern for a reduction.
llvm/lib/Transforms/Vectorize/VectorCombine.cpp
llvm/test/Transforms/PhaseOrdering/X86/vector-reductions.ll
llvm/test/Transforms/VectorCombine/X86/extract-binop.ll
llvm/test/Transforms/VectorCombine/X86/insert-binop.ll