summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit56d60eaa616498200d8090f45c2602e42e7c5385 (patch)
tree94453a749d3f8569295d8e3de31f64be14476c40 /llvm/lib
parent682d8c1881ba5609e79c4402ff8c05f2e7d618e5 (diff)
downloadbcm5719-llvm-56d60eaa616498200d8090f45c2602e42e7c5385.tar.gz
bcm5719-llvm-56d60eaa616498200d8090f45c2602e42e7c5385.zip
revert r79708 + r79711
llvm-svn: 79720
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index a3161b4c5e3..72f21125263 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/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];
}
}
OpenPOWER on IntegriCloud