[LV] Avoid scalable vectorization for loops containing alloca
authorKerry McLaughlin <kerry.mclaughlin@arm.com>
Fri, 16 Jul 2021 10:04:20 +0000 (11:04 +0100)
committerKerry McLaughlin <kerry.mclaughlin@arm.com>
Fri, 16 Jul 2021 10:47:13 +0000 (11:47 +0100)
commit49d73130ca17a19bd68c251451a4ff0c0cdc00e1
tree8045abab0f7b43ace6d940f35a20cf8a9da3ca37
parent99eb96f03186bf94476498979d5a6cd6a9cbf066
[LV] Avoid scalable vectorization for loops containing alloca

This patch returns an Invalid cost from getInstructionCost() for alloca
instructions if the VF is scalable, as otherwise loops which contain
these instructions will crash when attempting to scalarize the alloca.

Reviewed By: sdesmalen

Differential Revision: https://reviews.llvm.org/D105824
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
llvm/test/Transforms/LoopVectorize/AArch64/scalable-alloca.ll [new file with mode: 0644]