<div dir="ltr">Hi everyone,<br><br>I was watching this video [1]. There's an example of an initialization loop for which<br>Clang unfortunately generates really bad code [2]. In my machine, the Clang version<br>is 4x slower than the GCC version. I have not tested the MSVC version, but it should<br>be around the same.<br><br>In case anyone's interested, in the video [1] Casey explains why this code is bad (around 59:39).<br><br>So, I tried to run -print-after-all [3]. There are a lot of passes that interact here, so I was<br>wondering if anyone knows more about that. It seems to me that the problem starts<br>with SROA. Also, I'm not familiar with how these llvm.memcpy / memset are handled down<br>the pipeline. Finally, the regalloc probably did not go very well.<br><br>Best,<br>Stefanos<br><br>[1] <a href="https://youtu.be/R5tBY9Zyw6o?t=3580">https://youtu.be/R5tBY9Zyw6o?t=3580</a><br>[2] <a href="https://godbolt.org/z/9oWhEn">https://godbolt.org/z/9oWhEn</a><br>[3] <a href="https://godbolt.org/z/xa4jo9">https://godbolt.org/z/xa4jo9</a></div>