llvm / llvm/llvm-project

Performance regression from defining signed int overflow in -fms-compatibility mode

Open
#208,221 11 comments 0 reactions 1 assignee Claimed by @bavly-bob View on GitHub
clang:codegen llvm:optimizations regression:23
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

From https://github.com/llvm/llvm-project/pull/198538#issuecomment-4909059362

Our downstream testing at Intel ran into some performance differences that seem to come from these changes. For example, some code can no longer be vectorized (https://godbolt.org/z/7oeETzfY6) because compiler is unable to form the trip count of the loop due to the -fwrapv behavior:
```cpp
int x[40];
void doit1(int l, int u) {
int i;
#pragma clang loop vectorize(assume_safety)
for (i = l; i < u; i+= 3) x[i] += 1;
}
```
We also saw an 18% performance regression in SPEC2026 benchmarks such as cpu2026ref 772.marian_r.

CC @pankaj-chawla

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.