[compiler-rt] 1f04d8e - [tsan] Complete renaming kMaxSid to kThreadSlotCount
Benjamin Kramer via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 2 07:53:38 PDT 2021
Author: Benjamin Kramer
Date: 2021-08-02T16:52:29+02:00
New Revision: 1f04d8ed2e1d0719998ad5071194cb055841afc8
URL: https://github.com/llvm/llvm-project/commit/1f04d8ed2e1d0719998ad5071194cb055841afc8
DIFF: https://github.com/llvm/llvm-project/commit/1f04d8ed2e1d0719998ad5071194cb055841afc8.diff
LOG: [tsan] Complete renaming kMaxSid to kThreadSlotCount
This was missing from 5c2b48fdb0a6
Added:
Modified:
compiler-rt/lib/tsan/rtl/tsan_vector_clock.cpp
Removed:
################################################################################
diff --git a/compiler-rt/lib/tsan/rtl/tsan_vector_clock.cpp b/compiler-rt/lib/tsan/rtl/tsan_vector_clock.cpp
index b754a56c3346..278298565d3f 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_vector_clock.cpp
+++ b/compiler-rt/lib/tsan/rtl/tsan_vector_clock.cpp
@@ -24,7 +24,8 @@ VectorClock::VectorClock() { Reset(); }
void VectorClock::Reset() {
#if !TSAN_VECTORIZE
- for (uptr i = 0; i < kMaxSid; i++) clk_[i] = kEpochZero;
+ for (uptr i = 0; i < kThreadSlotCount; i++)
+ clk_[i] = kEpochZero;
#else
m128 z = _mm_setzero_si128();
m128* vclk = reinterpret_cast<m128*>(clk_);
@@ -36,7 +37,8 @@ void VectorClock::Acquire(const VectorClock* src) {
if (!src)
return;
#if !TSAN_VECTORIZE
- for (uptr i = 0; i < kMaxSid; i++) clk_[i] = max(clk_[i], src->clk_[i]);
+ for (uptr i = 0; i < kThreadSlotCount; i++)
+ clk_[i] = max(clk_[i], src->clk_[i]);
#else
m128* __restrict vdst = reinterpret_cast<m128*>(clk_);
m128 const* __restrict vsrc = reinterpret_cast<m128 const*>(src->clk_);
@@ -67,7 +69,8 @@ void VectorClock::ReleaseStore(VectorClock** dstp) const {
VectorClock& VectorClock::operator=(const VectorClock& other) {
#if !TSAN_VECTORIZE
- for (uptr i = 0; i < kMaxSid; i++) clk_[i] = other.clk_[i];
+ for (uptr i = 0; i < kThreadSlotCount; i++)
+ clk_[i] = other.clk_[i];
#else
m128* __restrict vdst = reinterpret_cast<m128*>(clk_);
m128 const* __restrict vsrc = reinterpret_cast<m128 const*>(other.clk_);
@@ -82,7 +85,7 @@ VectorClock& VectorClock::operator=(const VectorClock& other) {
void VectorClock::ReleaseStoreAcquire(VectorClock** dstp) {
VectorClock* dst = AllocClock(dstp);
#if !TSAN_VECTORIZE
- for (uptr i = 0; i < kMaxSid; i++) {
+ for (uptr i = 0; i < kThreadSlotCount; i++) {
Epoch tmp = dst->clk_[i];
dst->clk_[i] = clk_[i];
clk_[i] = max(clk_[i], tmp);
@@ -103,7 +106,7 @@ void VectorClock::ReleaseStoreAcquire(VectorClock** dstp) {
void VectorClock::ReleaseAcquire(VectorClock** dstp) {
VectorClock* dst = AllocClock(dstp);
#if !TSAN_VECTORIZE
- for (uptr i = 0; i < kMaxSid; i++) {
+ for (uptr i = 0; i < kThreadSlotCount; i++) {
dst->clk_[i] = max(dst->clk_[i], clk_[i]);
clk_[i] = dst->clk_[i];
}
More information about the llvm-commits
mailing list