[LoopVectorize] Fix crash for predicated instruction with scalable VF
authorCaroline Concatto <caroline.concatto@arm.com>
Wed, 5 May 2021 14:20:16 +0000 (15:20 +0100)
committerCaroline Concatto <caroline.concatto@arm.com>
Thu, 22 Jul 2021 11:48:27 +0000 (12:48 +0100)
commit5a4de84d55faa5502de38b4f7ec6c6ed43d90043
treedd934fc53566528aaf63f88d9c7ed688fa25e6ce
parent842e718b666f028e8fd3ea72d999fb5848767a02
[LoopVectorize] Fix crash for predicated instruction with scalable VF

This patch avoids computing discounts for predicated instructions  when the
VF is scalable.
There is no support for vectorization of loops with division because the
vectorizer cannot guarantee that zero divisions will not happen.

This loop now does not use VF scalable

```
for (long long i = 0; i < n; i++)
    if (cond[i])
      a[i] /= b[i];
```

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