summaryrefslogtreecommitdiffstats
path: root/include/clang/Basic/TargetInfo.h
diff options
context:
space:
mode:
authorWei Mi <wmi@google.com>2017-09-22 16:30:00 +0000
committerWei Mi <wmi@google.com>2017-09-22 16:30:00 +0000
commit5c5aea8028aa58b347eaf3b552bc158a2a85ee18 (patch)
tree59f3d84c43b86a2155750ad356c2183a68bd67d3 /include/clang/Basic/TargetInfo.h
parent9687f1d501bfff51838e70d124cd9a7463e1a727 (diff)
[Atomic][X8664] set max atomic inline width according to the target
This is to fix PR31620. MaxAtomicInlineWidth is set to 128 for x86_64. However for target without cx16 support, 128 atomic operation will generate __sync_* libcalls. The patch set MaxAtomicInlineWidth to 64 if the target doesn't support cx16. Differential Revision: https://reviews.llvm.org/D38046 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313992 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/TargetInfo.h')
-rw-r--r--include/clang/Basic/TargetInfo.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/clang/Basic/TargetInfo.h b/include/clang/Basic/TargetInfo.h
index 8bf31b075f..38a7bfed87 100644
--- a/include/clang/Basic/TargetInfo.h
+++ b/include/clang/Basic/TargetInfo.h
@@ -448,6 +448,9 @@ public:
/// \brief Return the maximum width lock-free atomic operation which can be
/// inlined given the supported features of the given target.
unsigned getMaxAtomicInlineWidth() const { return MaxAtomicInlineWidth; }
+ /// \brief Set the maximum inline or promote width lock-free atomic operation
+ /// for the given target.
+ virtual void setMaxAtomicWidth() {}
/// \brief Returns true if the given target supports lock-free atomic
/// operations at the specified width and alignment.
virtual bool hasBuiltinAtomic(uint64_t AtomicSizeInBits,