[llvm-branch-commits] [llvm] [BPF] Add CLI option to enable misaligned memory access (PR #167013)

Alex Rønne Petersen via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Nov 7 13:24:56 PST 2025


alexrp wrote:

Most backends use a subtarget feature to indicate whether unaligned access is allowed. See AArch64, AMDGPU, ARM, LoongArch, etc. Besides consistency, this is also *significantly* more convenient for frontends, especially those that produce bitcode directly (e.g. Zig), and less problematic for library users too as it avoids global state.

---

On a more general note (not directed at you @clairechingching!): I don't know what the community consensus is on this (if there is one), but IMHO, backends severely over(ab)use `cl::opt` for options that should be subtarget features, and putting on my frontend maintainer hat for a second, I'd really prefer if all backend maintainers made an effort to avoid this going forward.

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


More information about the llvm-branch-commits mailing list