[SLP]Fix PR58956: fix insertpoint for reduced buildvector graphs.
authorAlexey Bataev <a.bataev@outlook.com>
Wed, 16 Nov 2022 14:30:47 +0000 (06:30 -0800)
committerAlexey Bataev <a.bataev@outlook.com>
Wed, 16 Nov 2022 15:38:49 +0000 (07:38 -0800)
commit2f8f17c157825bd2310b4e5725f0f9d75996ef52
tree67f7f289f83e8ffe62d2bdaeb3e5435c6d97b14e
parent8fbb6f8678a08047b2a2186ff447160f56adbce8
[SLP]Fix PR58956: fix insertpoint for reduced buildvector graphs.

If the graph is only the buildvector node without main operation, need
to inherit insrtpoint from the redution instruction. Otherwise the
compiler crashes trying to insert instruction at the entry block.
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
llvm/test/Transforms/SLPVectorizer/AArch64/buildvector-reduce.ll [new file with mode: 0644]