[llvm-commits] [llvm] r79720 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Chris Lattner sabre at nondot.org
Fri Aug 21 21:07:39 PDT 2009


Author: lattner
Date: Fri Aug 21 23:07:34 2009
New Revision: 79720

URL: http://llvm.org/viewvc/llvm-project?rev=79720&view=rev
Log:
revert r79708 + r79711

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=79720&r1=79719&r2=79720&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Fri Aug 21 23:07:34 2009
@@ -5017,19 +5017,17 @@
 
 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];
   }
 }
 





More information about the llvm-commits mailing list