On Multi-Exit Loop Vectorizer

Hi All,

RFC in [1] proposed to perform loop vectorization in presence of multiple exits. I could find some patches [2, 3] essential for this that got upstreamed.

Is the implementation ready to be used now? If not, will this be landed in the near future?

When I tried with simple examples like the one below, vectorization was not happening.

int foo(float *a, int n){
int i;
for (i=0;i<n;i++){
if (a[i] == 0){
return i;

[1] https://lists.llvm.org/pipermail/llvm-dev/2019-September/134998.html
[2] https://reviews.llvm.org/D66688
[3] https://reviews.llvm.org/D93317

Thanks and Regards,

Hi All,

Any update on this query?


Progress has been slow. At the moment, I’m still working on getting support for loops with multiple exits where all exits are analyzeable. (The example below includes a data dependent exit, that’s a harder sub-problem.)

Currently, the progress on analyzeable exits is blocked on .