[llvm-bugs] [Bug 50331] New: clang spend relative much time on a simple code at -O3 (affect clang-6.0 above versions)
via llvm-bugs
llvm-bugs at lists.llvm.org
Thu May 13 09:42:46 PDT 2021
https://bugs.llvm.org/show_bug.cgi?id=50331
Bug ID: 50331
Summary: clang spend relative much time on a simple code at -O3
(affect clang-6.0 above versions)
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: Scalar Optimizations
Assignee: unassignedbugs at nondot.org
Reporter: haoxintu at gmail.com
CC: llvm-bugs at lists.llvm.org
Hi all.
As the title shows, clang-6.0 upwards versions spend much time (exceeded my
expectation) to compile the following simple C code. Is this a latent
performance bug existing for many years or it's just the intention of LLVM? If
it's the intention of LLVM, I apologize for the invalid report, and please
close it asap.
$cat small.c
#include <stdint.h>
int a;
void b() {
int16_t *c;
uint8_t d;
int16_t e = 1;
int64_t f;
for (;; c++)
for (d = 30; d <= 63; d++)
for (f = -19; f <= 87; f++)
*c += e ^= a;
}
I tested the following versions on my machine:
$time clang-trunk -w -O3 small.c
real 0m15.075s
user 0m14.764s
sys 0m0.310s
$time clang-12 -w -O3 small.c
real 0m20.437s
user 0m20.080s
sys 0m0.289s
$time clang-11 -w -O3 small.c
real 0m25.627s
user 0m21.636s
sys 0m0.425s
$time clang-10 -w -O3 small.c
real 0m28.128s
user 0m24.602s
sys 0m0.423s
$time clang-6.0 -w -3 small.c
real 0m14.500s
user 0m14.240s
sys 0m0.243s
And reproduced in Godbolt: https://godbolt.org/z/KjfEdax7b
(Output is "Killed - processing time exceeded" on clang-6.0 above versions)
Thanks,
Haoxin
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210513/3155d21b/attachment.html>
More information about the llvm-bugs
mailing list