Issue 114856
Summary vectorization regression in Clang 19
Labels clang
Assignees
Reporter eyelash
    When compiling the following code on x86-64 with `-O2`

```cpp
void foo(float* result, int size, float y, float delta) {
    for (int t = 0; t < size; ++t) {
        result[t] = y + delta * t;
 }
}
```

It generates a lot of code that seems suboptimal. After [asking on Stack Overflow](https://stackoverflow.com/q/79156564/799849) I was told that this is a regression in Clang 19 that I should report here. The comments and [this answer](https://stackoverflow.com/a/79156703/799849) on Stack Overflow shed more light into what's going on here.

[Here's a link to this example on Compiler Explorer with Clang trunk](https://godbolt.org/z/7Y67cKTfx) that shows the suboptimal assembly.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to