Live data from Hacker News

LLVM 9.0

lists.llvm.org

1–10 of 111 posts

Re: LLVM 9.0

#2
> Support for asm goto, enabling for example the mainline Linux kernel for x86_64 to build with Clang

This is an awesome step!

Re: LLVM 9.0

#3
> "Support for asm goto, enabling for example the mainline Linux kernel for x86_64 to build with Clang"

This is big. Support for asm goto was merged into the mainline earlier this year, but now it's released [1]. Aside from the obvious implications of this - being able to build the kernel with LLVM - working with eBPF/XDP just got way easier [2].

[1] https://github.com/llvm/llvm-project/commit/784929d0454c4df6...

[2] https://www.spinics.net/lists/netdev/msg544057.html

Re: LLVM 9.0

#4
>Support for asm goto, enabling for example the mainline Linux kernel for x86_64 to build with Clang

This is great for Linux, no longer being dependent on a single compiler for one of the most popular ISAs can only be a good thing for the overall health of the project. To be clear, I have nothing against gcc.

Re: LLVM 9.0

#5
> The optimizer will now convert calls to memcmp into a calls to bcmp in some circumstances.

What is the improvement from that change? I thought they were essentially the same.

Re: LLVM 9.0

#6

> The optimizer will now convert calls to memcmp into a calls to bcmp in some circumstances. What is the improvement from that change? I thought they were essentially the same.

bcmp just tells you "equal" or "not equal", while memcmp tells you "lesser", "equal", or "greater".

I don't really know, but I suppose it might be possible to make bcmp faster since you have less strict requirements on the return value.

Re: LLVM 9.0

#7
post #3

> "Support for asm goto, enabling for example the mainline Linux kernel for x86_64 to build with Clang" This is big. Support for asm goto was merged into the mainline earlier this year, but now it's released [1]. Aside from the obvious implications of this - being able to build the kernel with LLVM - working with eBPF/XDP just got way easier [2]. [1] https://github.com/llvm/llvm-project/commit/784929d0454c4df6... [2]…

Does this mean the Linux x86_64 kernel could only be built with gcc before this LLVM release?

Are there any downfalls of switching from gcc -> LLVM for kernel compilation? Why might somebody want to stick with gcc, why might somebody want to switch to LLVM?

Re: LLVM 9.0

#9

> The optimizer will now convert calls to memcmp into a calls to bcmp in some circumstances. What is the improvement from that change? I thought they were essentially the same.

memcmp returns the lexicographic ordering of the parameters () while bcmp only returns equality (anything nonzero is difference so memcmp is a suitable bcmp), so the LLVM folks believe worst case scenario bcmp will alias to memcmp, and possibly it'll have better performances since it has to do less: https://reviews.llvm.org/D56593

Re: LLVM 9.0

#10
post #3

> "Support for asm goto, enabling for example the mainline Linux kernel for x86_64 to build with Clang" This is big. Support for asm goto was merged into the mainline earlier this year, but now it's released [1]. Aside from the obvious implications of this - being able to build the kernel with LLVM - working with eBPF/XDP just got way easier [2]. [1] https://github.com/llvm/llvm-project/commit/784929d0454c4df6... [2]…

Does this mean the Linux x86_64 kernel could only be built with gcc before this LLVM release? Are there any downfalls of switching from gcc -> LLVM for kernel compilation? Why might somebody want to stick with gcc, why might somebody want to switch to LLVM?

Mainstream yes. Android has moved to clang for quite a while now, the Linux kernel is the only GPL piece left.
Post reply on HN