summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-08-22 04:07:34 +0000
committerChris Lattner <sabre@nondot.org>2009-08-22 04:07:34 +0000
commit895a55e66d107aa96a1e763a62a97e8ad62284a0 (patch)
treef71b195ace14b58540f4fc61d066e43825ee9453 /lib
parentce392eb3ea16b781de89b7ff8f42c39f8b3df30e (diff)
downloadllvm-895a55e66d107aa96a1e763a62a97e8ad62284a0.tar.gz
llvm-895a55e66d107aa96a1e763a62a97e8ad62284a0.tar.bz2
llvm-895a55e66d107aa96a1e763a62a97e8ad62284a0.tar.xz
revert r79708 + r79711
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79720 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAG.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index a3161b4c5e..72f2112526 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -5017,19 +5017,17 @@ void SDNode::Profile(FoldingSetNodeID &ID) const {
static ManagedStatic<std::set<EVT, EVT::compareRawBits> > EVTs;
static EVT VTs[MVT::LAST_VALUETYPE];
+static ManagedStatic<sys::SmartMutex<true> > VTMutex;
/// getValueTypeList - Return a pointer to the specified value type.
///
const EVT *SDNode::getValueTypeList(EVT VT) {
+ sys::SmartScopedLock<true> Lock(*VTMutex);
if (VT.isExtended()) {
return &(*EVTs->insert(VT).first);
} 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;
- sys::MemoryFence();
- return VTs + VT.getSimpleVT().SimpleTy;
+ return &VTs[VT.getSimpleVT().SimpleTy];
}
}