[clang] 81194bf - [Hexagon] MaxAtomicPromoteWidth and MaxAtomicInlineWidth are not getting set.

Sid Manning via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 30 10:34:23 PDT 2020


Author: Sid Manning
Date: 2020-03-30T12:33:51-05:00
New Revision: 81194bfeea7b40b6e8c543bb4ae49b59f590475b

URL: https://github.com/llvm/llvm-project/commit/81194bfeea7b40b6e8c543bb4ae49b59f590475b
DIFF: https://github.com/llvm/llvm-project/commit/81194bfeea7b40b6e8c543bb4ae49b59f590475b.diff

LOG: [Hexagon] MaxAtomicPromoteWidth and MaxAtomicInlineWidth are not getting set.

Noticed when building llvm's c++ library.

Differential Revision: https://reviews.llvm.org/D76546

Added: 
    

Modified: 
    clang/lib/Basic/Targets/Hexagon.h
    clang/test/Preprocessor/hexagon-predefines.c

Removed: 
    


################################################################################
diff  --git a/clang/lib/Basic/Targets/Hexagon.h b/clang/lib/Basic/Targets/Hexagon.h
index 89e3fa3fa6bf..7e173df81683 100644
--- a/clang/lib/Basic/Targets/Hexagon.h
+++ b/clang/lib/Basic/Targets/Hexagon.h
@@ -57,6 +57,7 @@ class LLVM_LIBRARY_VISIBILITY HexagonTargetInfo : public TargetInfo {
     LargeArrayAlign = 64;
     UseBitFieldTypeAlignment = true;
     ZeroLengthBitfieldBoundary = 32;
+    MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64;
 
     // These are the default values anyway, but explicitly make sure
     // that the size of the boolean type is 8 bits. Bool vectors are used

diff  --git a/clang/test/Preprocessor/hexagon-predefines.c b/clang/test/Preprocessor/hexagon-predefines.c
index 54013ceffa64..7979d567134b 100644
--- a/clang/test/Preprocessor/hexagon-predefines.c
+++ b/clang/test/Preprocessor/hexagon-predefines.c
@@ -113,3 +113,18 @@
 // CHECK-LINUX: #define __unix__ 1
 // CHECK-LINUX: #define linux 1
 // CHECK-LINUX: #define unix 1
+
+// RUN: %clang_cc1 -E -dM -triple hexagon-unknown-linux-musl \
+// RUN: -target-cpu hexagonv67 -target-feature +hvxv67 \
+// RUN: -target-feature +hvx-length128b %s | FileCheck \
+// RUN: %s -check-prefix CHECK-ATOMIC
+// CHECK-ATOMIC: #define __CLANG_ATOMIC_BOOL_LOCK_FREE 2
+// CHECK-ATOMIC: #define __CLANG_ATOMIC_CHAR16_T_LOCK_FREE 2
+// CHECK-ATOMIC: #define __CLANG_ATOMIC_CHAR32_T_LOCK_FREE 2
+// CHECK-ATOMIC: #define __CLANG_ATOMIC_CHAR_LOCK_FREE 2
+// CHECK-ATOMIC: #define __CLANG_ATOMIC_INT_LOCK_FREE 2
+// CHECK-ATOMIC: #define __CLANG_ATOMIC_LLONG_LOCK_FREE 2
+// CHECK-ATOMIC: #define __CLANG_ATOMIC_LONG_LOCK_FREE 2
+// CHECK-ATOMIC: #define __CLANG_ATOMIC_POINTER_LOCK_FREE 2
+// CHECK-ATOMIC: #define __CLANG_ATOMIC_SHORT_LOCK_FREE 2
+// CHECK-ATOMIC: #define __CLANG_ATOMIC_WCHAR_T_LOCK_FREE 2


        


More information about the cfe-commits mailing list