Issue 92719
Summary [clang] performance hog at -O2 with clang-14, and 19-init
Labels
Assignees
Reporter bi6c
    ```c
#include "csmith.h"

int a, b, c = 5;
void d() {
e:
  if (safe_add_func_int64_t_s_s(c, c))
    goto e;
}
int main() {
 for (; a >= 0; a--) {
    b = -18;
    for (; b != -10; b = safe_add_func_int16_t_s_s(b, 8)) {
      d();
    }
 }
}
```

OS: Ubuntu 22.04.3 LTS.
There is a performance difference when we compile it with (llvmorg-13.0.0) vs. (llvmorg-14.0.0 and llvmorg-19-init) at optimization level "-O2".

```console
$ ../compiler-builds/llvmorg-13.0.0_build/bin/clang -fsanitize=undefined -g -lgcc_s --rtlib=compiler-rt -I/home/csmith/include/csmith-2.3.0 -O2 testcase.c -o exec
$ timeout 2s ./exec

real    0m0.001s
user 0m0.001s
sys     0m0.000s

$ ../compiler-builds/llvmorg-14.0.0_build/bin/clang -fsanitize=undefined -g -lgcc_s --rtlib=compiler-rt -I/home/csmith/include/csmith-2.3.0 -O2 testcase.c -o exec
$ timeout 2s ./exec

real    0m2.000s
user 0m2.000s
sys     0m0.000s

$ ../compiler-builds/llvmorg-19-init_build/bin/clang -fsanitize=undefined -g -lgcc_s --rtlib=compiler-rt -I/home/csmith/include/csmith-2.3.0 -O2 testcase.c -o exec
$ timeout 2s ./exec

real    0m2.000s
user 0m2.000s
sys     0m0.000s
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to