[llvm] BPF: Ensure __sync_fetch_and_add() always generate atomic_fetch_add insn (PR #101428)

Bryce Kahle via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 26 09:05:57 PDT 2024


brycekahle wrote:

@yonghong-song what is the best place for me to voice my concerns? We ship object files to our Datadog customers that target a wide range of kernels, going much further back than 5.12. The total customer host install count is 400,000+. We do not have the luxury of only deploying eBPF on internal infrastructure where we have total control of the kernel version used.

We also intentionally limit ourselves to `v1` of the instruction set. Having the compiler generate `v3` instructions, even when specifying `v1`, seems like a bug and a breaking change.

At the very least, there should be a non-inline assembly way for us to explicitly use the `XADD` instruction. Inline BPF assembly has its own challenges if you cannot use `clang -target bpf`, but must use `clang + llc -march=bpf`.

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


More information about the llvm-commits mailing list