diff --git a/bolt/include/bolt/Passes/ShrinkWrapping.h b/bolt/include/bolt/Passes/ShrinkWrapping.h --- a/bolt/include/bolt/Passes/ShrinkWrapping.h +++ b/bolt/include/bolt/Passes/ShrinkWrapping.h @@ -308,8 +308,8 @@ std::vector BestSavePos; /// Pass stats - static uint64_t SpillsMovedRegularMode; - static uint64_t SpillsMovedPushPopMode; + static std::atomic_uint64_t SpillsMovedRegularMode; + static std::atomic_uint64_t SpillsMovedPushPopMode; Optional AnnotationIndex; diff --git a/bolt/lib/Passes/ShrinkWrapping.cpp b/bolt/lib/Passes/ShrinkWrapping.cpp --- a/bolt/lib/Passes/ShrinkWrapping.cpp +++ b/bolt/lib/Passes/ShrinkWrapping.cpp @@ -710,8 +710,8 @@ IsInitialized = true; } -uint64_t ShrinkWrapping::SpillsMovedRegularMode = 0; -uint64_t ShrinkWrapping::SpillsMovedPushPopMode = 0; +std::atomic_uint64_t ShrinkWrapping::SpillsMovedRegularMode{0}; +std::atomic_uint64_t ShrinkWrapping::SpillsMovedPushPopMode{0}; using BBIterTy = BinaryBasicBlock::iterator;