Issue 91710
Summary lower performance of frequent jumps with goto statements
Labels new issue
Assignees
Reporter bi6c
    ```c
#include <stdint.h>

static uint32_t a = 0x466AC3A6L;

int main (int argc, char* argv[])
{
p1:
    a--;
      if (a)
          goto p1;
}
```

Hello, we are using clang to compile the above code in Ubuntu 22.04.3 LTS.
When the value of `a` increases, the execution time difference also increases when we compile it with llvmorg-13.0.0 and llvmorg-19-init. The execution time result of above code is shown below.

```
~/compiler-builds/llvmorg-13.0.0_build/bin/clang test.c -o exec1
time ./exec1

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

~/compiler-builds/llvmorg-19-init_build/bin/clang test.c -o exec2
time ./exec2

real    0m1.738s
user    0m1.738s
sys 0m0.000s
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to