[llvm-dev] A 4x slower initialization loop in LLVM vs GCC and MSVC

Stefanos Baziotis via llvm-dev llvm-dev at lists.llvm.org
Sun Sep 27 04:52:29 PDT 2020


Hi everyone,

I was watching this video [1]. There's an example of an initialization loop
for which
Clang unfortunately generates really bad code [2]. In my machine, the Clang
version
is 4x slower than the GCC version. I have not tested the MSVC version, but
it should
be around the same.

In case anyone's interested, in the video [1] Casey explains why this code
is bad (around 59:39).

So, I tried to run -print-after-all [3]. There are a lot of passes that
interact here, so I was
wondering if anyone knows more about that. It seems to me that the problem
starts
with SROA. Also, I'm not familiar with how these llvm.memcpy / memset are
handled down
the pipeline. Finally, the regalloc probably did not go very well.

Best,
Stefanos

[1] https://youtu.be/R5tBY9Zyw6o?t=3580
[2] https://godbolt.org/z/9oWhEn
[3] https://godbolt.org/z/xa4jo9
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200927/e3d32312/attachment.html>


More information about the llvm-dev mailing list