[SVE][LoopVectorize] Fix crash in InnerLoopVectorizer::widenPHIInstruction
authorDavid Sherwood <david.sherwood@arm.com>
Tue, 23 Mar 2021 16:28:09 +0000 (16:28 +0000)
committerDavid Sherwood <david.sherwood@arm.com>
Thu, 15 Apr 2021 09:51:49 +0000 (10:51 +0100)
commitea14df695ebde3f5bdd5ba7548d3d49e8f1c4411
tree31abee0f49ad6db5e94c376bd25b0312889cec77
parenteae0ac3a1f4c63762577520b2a4ad6c6ed144323
[SVE][LoopVectorize] Fix crash in InnerLoopVectorizer::widenPHIInstruction

There were a few places in widenPHIInstruction where calculations of
offsets were failing to take the runtime calculation of VF into
account for scalable vectors. I've fixed those cases in this patch
as well as adding an assert that we should not be scalarising for
scalable vectors.

Tests are added here:

  Transforms/LoopVectorize/AArch64/sve-widen-phi.ll

Differential Revision: https://reviews.llvm.org/D99254
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
llvm/test/Transforms/LoopVectorize/AArch64/sve-widen-phi.ll [new file with mode: 0644]