Displaying 3 results from an estimated 3 matches for "call_once_initialization".
2011 Nov 07
0
[LLVMdev] r139934 requires (correct?) code organization changes
...w option containing
info for a pass; in this case the DominatorTree pass. The state of the system asserts
because a DominatorTree pass option has already been created. This is perplexing since
this means that the atomic compare and swap operation on static var "initialized"
contained in CALL_ONCE_INITIALIZATION(...) did not prevent the pass's associated
initialize""PassOnce(...) function from being invoked more than once. Logically, baring
other knowledge, the only way this can happen is that CALL_ONCE_INITIALIZATION(...)
is instantiated in at least two places. Although I forced the examp...
2016 Apr 16
2
[TSAN] LLVM statistics and pass initialization trigger race detection
...but not to read the return value, so the
// return value is not thread safe.
Can we tell TSAN to ignore the statistics somehow? Alternatively, is there a fix someone can suggest?
2) Pass initialization. This macro does not please TSAN (even though it seems written with TSAN in mind):
#define CALL_ONCE_INITIALIZATION(function) \
static volatile sys::cas_flag initialized = 0; \
sys::cas_flag old_val = sys::CompareAndSwap(&initialized, 1, 0); \
if (old_val == 0) { \
function(Registry); \
sys::MemoryFence(); \
TsanIgnoreWritesBegin(); \
TsanHappensBefore(&initialized); \
initializ...
2015 Feb 24
2
[LLVMdev] Removing contention in PassRegistry accesses to speed up compiles
...vm/llvm.svnrev.170375/include/llvm/PassSupport.h
index 3633f47..44b4d56 100644
--- a/llvm/llvm.svnrev.170375/include/llvm/PassSupport.h
+++ b/llvm/llvm.svnrev.170375/include/llvm/PassSupport.h
@@ -130,25 +130,14 @@ private:
PassInfo(const PassInfo &) LLVM_DELETED_FUNCTION;
};
+
+
#define CALL_ONCE_INITIALIZATION(function) \
- static volatile sys::cas_flag initialized = 0; \
- sys::cas_flag old_val = sys::CompareAndSwap(&initialized, 1, 0); \
- if (old_val == 0) { \
+ static __thread int initialized = 0; \
+ if (initialized == 0) { \
function(Registry); \
- sys::MemoryFence(); \
- TsanIg...