[PATCH] D45321: [atomics] Fix runtime calls for misaligned atomics
Tim Northover via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 5 07:26:14 PDT 2018
t.p.northover added a comment.
Atomics accessed via C11 _Atomic and C++11 std::atomic will be suitably aligned, but there's a reasonable amount of legacy code that uses the GCC builtins on non-atomic types (of unknown alignment) and this is what Clang uses to implement those accesses when they come up. Also, on the LLVM side there are even fewer restrictions and `load atomic i32, i32* %ptr monotonic, align 1` is perfectly valid IR that gets lowered to these calls.
In parallel I'm trying to add a performance warning for when Clang hits this issue and is forced to generate libcalls.
Repository:
rCRT Compiler Runtime
https://reviews.llvm.org/D45321
More information about the llvm-commits
mailing list