[PATCH] D122377: [PowerPC][Linux] Support 16-byte lock free atomics on pwr8 and up
Eli Friedman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 25 09:33:13 PDT 2022
efriedma added inline comments.
================
Comment at: clang/lib/Basic/Targets/PPC.h:451
+ MaxAtomicPromoteWidth = 128;
+ MaxAtomicInlineWidth = 128;
+ }
----------------
MaxAtomicPromoteWidth should not depend on whether quadword-atomics is present, only the target OS. It determines the layout of `_Atomic(__int128_t)`.
(MaxAtomicInlineWidth is allowed to adjust as necessary.)
================
Comment at: clang/lib/Driver/ToolChains/Clang.cpp:2140
+ CmdArgs.push_back("-mllvm");
+ CmdArgs.push_back("-ppc-quadword-atomics");
+ }
----------------
Please avoid using "-mllvm" options like this; among other issues, it doesn't work with LTO. If we need to indicate this, please use a function attribute in the IR.
(Yes, there are other cases where we translate flags to -mllvm options, but it's not something you should copy.)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D122377/new/
https://reviews.llvm.org/D122377
More information about the cfe-commits
mailing list