[llvm] [SDag][ARM][RISCV] Allow lowering CTPOP into a libcall (PR #101786)

Sergei Barannikov via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 5 04:06:33 PDT 2024


s-barannikov wrote:

> For what it's worth, not everything links against the compiler runtime, such as the Linux kernel.

gcc does generate a libcall for __builtin_popcount [link](https://gcc.godbolt.org/z/3cesrWf63) and somehow manages to build the kernel. Or the kernel doesn't use builtins and it is the compiler that emitted a libcall even though it wasn't in the source?
Is it possible that there is a compiler flag that should suppress recognition of libcall patterns?

Note that popcount is not the only libcall that the compiler can generate, but it appears to be only one that breaks the build.


https://github.com/llvm/llvm-project/pull/101786


More information about the llvm-commits mailing list