[SLP]Improve/fix reordering of the gathered graph nodes.
authorAlexey Bataev <a.bataev@outlook.com>
Mon, 25 Oct 2021 14:32:35 +0000 (07:32 -0700)
committerAlexey Bataev <a.bataev@outlook.com>
Wed, 27 Oct 2021 13:08:40 +0000 (06:08 -0700)
commitf719b794bcaa1df8fa82659d6d4e754c77d2f94e
tree7f85667f5cb45e2389fbf8503d8417951191022c
parentc1f3d08b06129b670778bae13566a0f3ea9c0588
[SLP]Improve/fix reordering of the gathered graph nodes.

Gathered loads/extractelements/extractvalue instructions should be
checked if they can represent a vector reordering node too and their
order should ve taken into account for better graph reordering analysis/
Also, if the gather node has reused scalars, they must be reordered
instead of the scalars themselves.

Differential Revision: https://reviews.llvm.org/D112454
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
llvm/test/Transforms/SLPVectorizer/AArch64/transpose-inseltpoison.ll
llvm/test/Transforms/SLPVectorizer/AArch64/transpose.ll
llvm/test/Transforms/SLPVectorizer/X86/jumbled-load.ll
llvm/test/Transforms/SLPVectorizer/X86/lookahead.ll