[PATCH] D83361: [LLVM] Add libatomic load/store functions to TargetLibraryInfo

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 16 13:07:31 PDT 2020


efriedma added inline comments.


================
Comment at: llvm/lib/Analysis/TargetLibraryInfo.cpp:558
+  // LLVM will generate calls to them which may be fulfilled by compiler-rt
+  if (isARM || T.isX86() || T.isPPC64() || T.isRISCV()) {
+    TLI.setAvailable(LibFunc_atomic_load);
----------------
Checking for specific targets seems like a trap that's going to "randomly" break more obscure targets.

I think I'd be happy to say these are "always" available, in the sense that we should assume a function named __atomic_load is always the libatomic one.  (In practice, whether they're actually available at link-time might vary depending on how the user links their code, but we shouldn't be introducing new calls to these anyway.)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83361/new/

https://reviews.llvm.org/D83361





More information about the llvm-commits mailing list