r184113 - Use atomic instructions on Bitrig armv6. Patch by Patrick Wildt.
Rafael Espindola
rafael.espindola at gmail.com
Mon Jun 17 13:00:15 PDT 2013
Author: rafael
Date: Mon Jun 17 15:00:15 2013
New Revision: 184113
URL: http://llvm.org/viewvc/llvm-project?rev=184113&view=rev
Log:
Use atomic instructions on Bitrig armv6. Patch by Patrick Wildt.
Modified:
cfe/trunk/lib/Basic/Targets.cpp
cfe/trunk/test/CodeGen/linux-arm-atomic.c
Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=184113&r1=184112&r2=184113&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Mon Jun 17 15:00:15 2013
@@ -3534,7 +3534,9 @@ class ARMTargetInfo : public TargetInfo
// the kernel which on armv6 and newer uses ldrex and strex. The net result
// is that if we assume the kernel is at least as recent as the hardware,
// it is safe to use atomic instructions on armv6 and newer.
- if (T.getOS() != llvm::Triple::Linux && T.getOS() != llvm::Triple::FreeBSD)
+ if (T.getOS() != llvm::Triple::Linux &&
+ T.getOS() != llvm::Triple::FreeBSD &&
+ T.getOS() != llvm::Triple::Bitrig)
return false;
StringRef ArchName = T.getArchName();
if (T.getArch() == llvm::Triple::arm) {
Modified: cfe/trunk/test/CodeGen/linux-arm-atomic.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/linux-arm-atomic.c?rev=184113&r1=184112&r2=184113&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/linux-arm-atomic.c (original)
+++ cfe/trunk/test/CodeGen/linux-arm-atomic.c Mon Jun 17 15:00:15 2013
@@ -2,6 +2,7 @@
// RUN: %clang_cc1 %s -emit-llvm -o - -triple=armv6-unknown-linux | FileCheck %s
// RUN: %clang_cc1 %s -emit-llvm -o - -triple=thumbv7-unknown-linux | FileCheck %s
// RUN: %clang_cc1 %s -emit-llvm -o - -triple=armv6-unknown-freebsd | FileCheck %s
+// RUN: %clang_cc1 %s -emit-llvm -o - -triple=armv6-unknown-bitrig | FileCheck %s
typedef int _Atomic_word;
_Atomic_word exchange_and_add(volatile _Atomic_word *__mem, int __val) {
More information about the cfe-commits
mailing list