Issue 180180
Summary Vectorization fails as soon as memory is allocated in the same function
Labels new issue
Assignees
Reporter philnik777
    ```
#include <algorithm>
#include <vector>

int* ptr;

auto test1(std::vector<int>& v, int n) {
  ptr = new int;
  return std::find_if(v.begin(), v.end(), [n](int v) { return v < n; });
}

auto test2(std::vector<int>& v, int n) {
  return std::find_if(v.begin(), v.end(), [n](int v) { return v < n; });
}
```

should generate the same code for both functions except for the additional allocation in `test1`. However, one seems to be unrolled, while the other gets vectorized.

https://godbolt.org/z/j47ehxef9

CC @fhahn
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to