[compiler-rt] r293505 - [XRay][ARM32][AArch64] Fix unstable FDR tests on weak-ordering CPUs
Serge Rogatch via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 30 09:10:49 PST 2017
Author: rserge
Date: Mon Jan 30 11:10:49 2017
New Revision: 293505
URL: http://llvm.org/viewvc/llvm-project?rev=293505&view=rev
Log:
[XRay][ARM32][AArch64] Fix unstable FDR tests on weak-ordering CPUs
Summary: Change from `compare_exchange_weak()` to `compare_exchange_strong()` where appropriate, because on ARM ( http://lab.llvm.org:8011/builders/clang-cmake-armv7-a15-full/builds/3190 , http://lab.llvm.org:8011/builders/clang-cmake-armv7-a15-full/builds/3191 ) and AArch64 ( http://lab.llvm.org:8011/builders/clang-cmake-aarch64-42vma/builds/3900 ) it fails even in single-threaded scenarios.
Reviewers: dberris, rengolin
Reviewed By: rengolin
Subscribers: aemerson, llvm-commits, iid_iunknown
Differential Revision: https://reviews.llvm.org/D29286
Modified:
compiler-rt/trunk/lib/xray/xray_fdr_logging.cc
Modified: compiler-rt/trunk/lib/xray/xray_fdr_logging.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/xray/xray_fdr_logging.cc?rev=293505&r1=293504&r2=293505&view=diff
==============================================================================
--- compiler-rt/trunk/lib/xray/xray_fdr_logging.cc (original)
+++ compiler-rt/trunk/lib/xray/xray_fdr_logging.cc Mon Jan 30 11:10:49 2017
@@ -59,7 +59,7 @@ XRayLogInitStatus FDRLogging_init(std::s
size_t OptionsSize) XRAY_NEVER_INSTRUMENT {
assert(OptionsSize == sizeof(FDRLoggingOptions));
XRayLogInitStatus CurrentStatus = XRayLogInitStatus::XRAY_LOG_UNINITIALIZED;
- if (!LoggingStatus.compare_exchange_weak(
+ if (!LoggingStatus.compare_exchange_strong(
CurrentStatus, XRayLogInitStatus::XRAY_LOG_INITIALIZING,
std::memory_order_release, std::memory_order_relaxed))
return CurrentStatus;
@@ -91,7 +91,7 @@ XRayLogFlushStatus FDRLogging_flush() XR
return XRayLogFlushStatus::XRAY_LOG_NOT_FLUSHING;
XRayLogFlushStatus Result = XRayLogFlushStatus::XRAY_LOG_NOT_FLUSHING;
- if (!LogFlushStatus.compare_exchange_weak(
+ if (!LogFlushStatus.compare_exchange_strong(
Result, XRayLogFlushStatus::XRAY_LOG_FLUSHING,
std::memory_order_release, std::memory_order_relaxed))
return Result;
@@ -143,7 +143,7 @@ XRayLogFlushStatus FDRLogging_flush() XR
XRayLogInitStatus FDRLogging_finalize() XRAY_NEVER_INSTRUMENT {
XRayLogInitStatus CurrentStatus = XRayLogInitStatus::XRAY_LOG_INITIALIZED;
- if (!LoggingStatus.compare_exchange_weak(
+ if (!LoggingStatus.compare_exchange_strong(
CurrentStatus, XRayLogInitStatus::XRAY_LOG_FINALIZING,
std::memory_order_release, std::memory_order_relaxed))
return CurrentStatus;
@@ -159,7 +159,7 @@ XRayLogInitStatus FDRLogging_finalize()
XRayLogInitStatus FDRLogging_reset() XRAY_NEVER_INSTRUMENT {
XRayLogInitStatus CurrentStatus = XRayLogInitStatus::XRAY_LOG_FINALIZED;
- if (!LoggingStatus.compare_exchange_weak(
+ if (!LoggingStatus.compare_exchange_strong(
CurrentStatus, XRayLogInitStatus::XRAY_LOG_UNINITIALIZED,
std::memory_order_release, std::memory_order_relaxed))
return CurrentStatus;
More information about the llvm-commits
mailing list