[PATCH] D127189: [clang][AIX] Add option to control quadword lock free atomics ABI on AIX

Kai Luo via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 21 22:38:45 PDT 2022


lkail added inline comments.


================
Comment at: clang/include/clang/Driver/Options.td:3611
   HelpText<"Enable the default Altivec ABI on AIX (AIX only). Uses only volatile vector registers.">;
+def maix_quadword_atomics : Flag<["-"], "maix64-quadword-atomics">,
+  Group<m_Group>, Flags<[CC1Option]>,
----------------
shchenz wrote:
> amyk wrote:
> > Would it be better if we called this `maix64-quadword-atomics` instead? 
> Do we need to change the backend check below too?
> ```
> bool PPCTargetLowering::shouldInlineQuadwordAtomics() const {
>   // TODO: 16-byte atomic type support for AIX is in progress; we should be able
>   // to inline 16-byte atomic ops on AIX too in the future.
>   return Subtarget.isPPC64() &&
>          (EnableQuadwordAtomics || !Subtarget.getTargetTriple().isOSAIX()) &&
>          Subtarget.hasQuadwordAtomics();
> }
> ```
We don't need to change this yet. When we are compiling a quadword lock free libatomic, we use options `-mabi=quadword-atomics -mllvm -ppc-quadword-atomics` to enforce generating quadword lock-free code on AIX.


================
Comment at: clang/lib/Basic/Targets/PPC.cpp:854
+      HasQuadwordAtomics)
+    MaxAtomicInlineWidth = 128;
 }
----------------
shchenz wrote:
> Can we set `MaxAtomicInlineWidth` in `PPC64TargetInfo::setMaxAtomicWidth()`? There is a `TODO` there
The `TODO` marks our roadmap towards enabling quardword lock free atomics on AIX too. Putting adjustment here is implementation reason: we don't context of `LanguageOptions` in `PPC64TargetInfo::PPC64TargetInfo`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127189



More information about the cfe-commits mailing list