mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-14 14:24:05 +00:00
Move the memory fences out of the path for single-threaded mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73775 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -198,9 +198,9 @@ static PassRegistrar *getPassRegistrar() {
|
|||||||
// Use double-checked locking to safely initialize the registrar when
|
// Use double-checked locking to safely initialize the registrar when
|
||||||
// we're running in multithreaded mode.
|
// we're running in multithreaded mode.
|
||||||
PassRegistrar* tmp = PassRegistrarObj;
|
PassRegistrar* tmp = PassRegistrarObj;
|
||||||
sys::MemoryFence();
|
if (llvm_is_multithreaded()) {
|
||||||
if (!tmp) {
|
sys::MemoryFence();
|
||||||
if (llvm_is_multithreaded()) {
|
if (!tmp) {
|
||||||
llvm_acquire_global_lock();
|
llvm_acquire_global_lock();
|
||||||
tmp = PassRegistrarObj;
|
tmp = PassRegistrarObj;
|
||||||
if (!tmp) {
|
if (!tmp) {
|
||||||
@ -209,10 +209,11 @@ static PassRegistrar *getPassRegistrar() {
|
|||||||
PassRegistrarObj = tmp;
|
PassRegistrarObj = tmp;
|
||||||
}
|
}
|
||||||
llvm_release_global_lock();
|
llvm_release_global_lock();
|
||||||
} else {
|
|
||||||
PassRegistrarObj = new PassRegistrar();
|
|
||||||
}
|
}
|
||||||
|
} else if (!tmp) {
|
||||||
|
PassRegistrarObj = new PassRegistrar();
|
||||||
}
|
}
|
||||||
|
|
||||||
return PassRegistrarObj;
|
return PassRegistrarObj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -458,9 +458,9 @@ void DerivedType::dropAllTypeUses() {
|
|||||||
static Type *AlwaysOpaqueTy = 0;
|
static Type *AlwaysOpaqueTy = 0;
|
||||||
static PATypeHolder* Holder = 0;
|
static PATypeHolder* Holder = 0;
|
||||||
Type *tmp = AlwaysOpaqueTy;
|
Type *tmp = AlwaysOpaqueTy;
|
||||||
sys::MemoryFence();
|
if (llvm_is_multithreaded()) {
|
||||||
if (!tmp) {
|
sys::MemoryFence();
|
||||||
if (llvm_is_multithreaded()) {
|
if (!tmp) {
|
||||||
llvm_acquire_global_lock();
|
llvm_acquire_global_lock();
|
||||||
tmp = AlwaysOpaqueTy;
|
tmp = AlwaysOpaqueTy;
|
||||||
if (!tmp) {
|
if (!tmp) {
|
||||||
@ -472,12 +472,12 @@ void DerivedType::dropAllTypeUses() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
llvm_release_global_lock();
|
llvm_release_global_lock();
|
||||||
} else {
|
}
|
||||||
AlwaysOpaqueTy = OpaqueType::get();
|
} else {
|
||||||
Holder = new PATypeHolder(AlwaysOpaqueTy);
|
AlwaysOpaqueTy = OpaqueType::get();
|
||||||
}
|
Holder = new PATypeHolder(AlwaysOpaqueTy);
|
||||||
}
|
}
|
||||||
|
|
||||||
ContainedTys[0] = AlwaysOpaqueTy;
|
ContainedTys[0] = AlwaysOpaqueTy;
|
||||||
|
|
||||||
// Change the rest of the types to be Int32Ty's. It doesn't matter what we
|
// Change the rest of the types to be Int32Ty's. It doesn't matter what we
|
||||||
|
Reference in New Issue
Block a user