News: 0001615989

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

LLVM Clang 22 Compiler Performance Largely Unchanged Over Clang 21 On AMD Zen 5

([Software] 3 Hours Ago Add A Comment)


With [1]yesterday's stable release of the LLVM Clang 22 compiler it didn't take long for Phoronix readers to begin asking about the performance of this half-year feature update to this prominent open-source C/C++ compiler. What I am seeing so far are no big surprises with the performance largely being similar to Clang 21 across various open-source C/C++ workloads in the testing thus far. This initial round of reference benchmark results between LLVM [2]Clang 22 , Clang 21, and Clang 20 were done on an AMD EPYC Turin (Zen 5) Linux server.

So far I haven't yet seen any surprises out of my Clang 22.1 compiler benchmarking on x86_64 hardware. I've tested a few Intel and AMD systems to no major changes. Most of the benchmarks were done thus far from an AMD EPYC 9655P server given its speed with 96 Zen 5 cores and twelve channels of DDR5 memory. So this article has those results comparing the new Clang 22.1.0 to the existing Clang 21.1.8 and Clang 20.1.8 releases. Again, no major surprises though. In some workloads there were some incremental gains but nothing too extreme like we've encountered in LLVM/Clang releases years ago.

These days the LLVM/Clang x86_64 performance of the resulting binaries is largely inline with that of the GCC compiler. Healthy neck-and-neck performance between the two with a few exceptions, but aside from when it comes to supporting new CPU instructions or the occasional new optimization or other target-specific scheduling improvements and the like, the LLVM/Clang performance has largely seemed to plateau in recent releases. But it's a good thing it's caught up over the years to being a viable contender in all aspects to GCC -- not just for the performance of the resulting binaries but also when it comes to building complex codebases like the Linux kernel and other projects. All of the open-source C/C++ software under test was built while the CFLAGS/CXXFLAGS were set to "-march=native -O3 -flto".



[1] https://www.phoronix.com/news/LLVM-Clang-22.1-Released

[2] https://www.phoronix.com/search/Clang+22



Long ago, in a finite state far away, there lived a JOVIAL
character named Jack. Jack and his relations were poor. Often their
hash table was bare. One day Jack's parent said to him, "Our matrices
are sparse. You must go to the market to exchange our RAM for some
BASICs." She compiled a linked list of items to retrieve and passed it
to him.
So Jack set out. But as he was walking along a Hamilton path,
he met the traveling salesman.
"Whither dost thy flow chart take thou?" prompted the salesman
in high-level language.
"I'm going to the market to exchange this RAM for some chips
and Apples," commented Jack.
"I have a much better algorithm. You needn't join a queue
there; I will swap your RAM for these magic kernels now."
Jack made the trade, then backtracked to his house. But when
he told his busy-waiting parent of the deal, she became so angry she
started thrashing.
"Don't you even have any artificial intelligence? All these
kernels together hardly make up one byte," and she popped them out the
window...
-- Mark Isaak, "Jack and the Beanstack"