[SLPVectorizer] Fix crash in isShuffle with scalable vectors
authorKerry McLaughlin <kerry.mclaughlin@arm.com>
Fri, 1 Oct 2021 08:43:27 +0000 (09:43 +0100)
committerKerry McLaughlin <kerry.mclaughlin@arm.com>
Fri, 1 Oct 2021 09:56:44 +0000 (10:56 +0100)
commitc1d46d34619bea0d9906874baafb5218e15e3b2a
tree38f3e798df16d35ddb76adf04b95526e323cb329
parent57fbb9ed0e4c9717b1106ce18f5653ce8f7136fa
[SLPVectorizer] Fix crash in isShuffle with scalable vectors

D104809 changed `buildTree_rec` to check for extract element instructions
with scalable types. However, if the extract is extended or truncated,
these changes do not apply and we assert later on in isShuffle(), which
attempts to cast the type of the extract to FixedVectorType.

Reviewed By: ABataev

Differential Revision: https://reviews.llvm.org/D110640
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
llvm/test/Transforms/SLPVectorizer/AArch64/scalable-vector.ll