mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-15 21:24:00 +00:00
Reapply r79708 with the appropriate fix for the case that still requires locking.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79731 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -5022,12 +5022,16 @@ static ManagedStatic<sys::SmartMutex<true> > VTMutex;
|
|||||||
/// getValueTypeList - Return a pointer to the specified value type.
|
/// getValueTypeList - Return a pointer to the specified value type.
|
||||||
///
|
///
|
||||||
const EVT *SDNode::getValueTypeList(EVT VT) {
|
const EVT *SDNode::getValueTypeList(EVT VT) {
|
||||||
sys::SmartScopedLock<true> Lock(*VTMutex);
|
|
||||||
if (VT.isExtended()) {
|
if (VT.isExtended()) {
|
||||||
|
sys::SmartScopedLock<true> Lock(*VTMutex);
|
||||||
return &(*EVTs->insert(VT).first);
|
return &(*EVTs->insert(VT).first);
|
||||||
} else {
|
} else {
|
||||||
|
// All writes to this location will have the same value, so it's ok
|
||||||
|
// to race on it. We only need to ensure that at least one write has
|
||||||
|
// succeeded before we return the pointer into the array.
|
||||||
VTs[VT.getSimpleVT().SimpleTy] = VT;
|
VTs[VT.getSimpleVT().SimpleTy] = VT;
|
||||||
return &VTs[VT.getSimpleVT().SimpleTy];
|
sys::MemoryFence();
|
||||||
|
return VTs + VT.getSimpleVT().SimpleTy;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user