[llvm-branch-commits] [llvm-branch] r109193 - /llvm/branches/ggreif/waymark-64/lib/VMCore/Use.cpp

Gabor Greif ggreif at gmail.com
Thu Jul 22 15:46:23 PDT 2010


Author: ggreif
Date: Thu Jul 22 17:46:23 2010
New Revision: 109193

URL: http://llvm.org/viewvc/llvm-project?rev=109193&view=rev
Log:
add a simplistic initTags<3>

Modified:
    llvm/branches/ggreif/waymark-64/lib/VMCore/Use.cpp

Modified: llvm/branches/ggreif/waymark-64/lib/VMCore/Use.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/waymark-64/lib/VMCore/Use.cpp?rev=109193&r1=109192&r2=109193&view=diff
==============================================================================
--- llvm/branches/ggreif/waymark-64/lib/VMCore/Use.cpp (original)
+++ llvm/branches/ggreif/waymark-64/lib/VMCore/Use.cpp Thu Jul 22 17:46:23 2010
@@ -90,7 +90,7 @@
 //===----------------------------------------------------------------------===//
 
 template <>
-Use *Use::initTags<Use::availableTagBits>(Use * const Start, Use *Stop, ptrdiff_t Done) {
+Use *Use::initTags<2>(Use * const Start, Use *Stop, ptrdiff_t Done) {
   while (Done < 20) {
     if (Start == Stop--)
       return Start;
@@ -124,6 +124,33 @@
   return Start;
 }
 
+template <>
+Use *Use::initTags<3>(Use * const Start, Use *Stop, ptrdiff_t Done) {
+  if (Done == 0) {
+    ++Done;
+    --Stop;
+    Stop->Val = 0;
+    Stop->Prev.setFromOpaqueValue(reinterpret_cast<Use**>(fullStop64Tag));
+	}
+
+  ptrdiff_t Count = Done;
+  while (Start != Stop) {
+    --Stop;
+    Stop->Val = 0;
+    if (!Count) {
+      Stop->Prev.setFromOpaqueValue(reinterpret_cast<Use**>(stop64Tag));
+      ++Done;
+      Count = Done;
+    } else {
+      Stop->Prev.setFromOpaqueValue(reinterpret_cast<Use**>(Count & 3));
+      Count >>= 2;
+      ++Done;
+    }
+  }
+
+  return Start;
+}
+
 //===----------------------------------------------------------------------===//
 //                         Use zap Implementation
 //===----------------------------------------------------------------------===//





More information about the llvm-branch-commits mailing list