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

Gabor Greif ggreif at gmail.com
Thu Sep 9 11:17:12 PDT 2010


Author: ggreif
Date: Thu Sep  9 13:17:12 2010
New Revision: 113512

URL: http://llvm.org/viewvc/llvm-project?rev=113512&view=rev
Log:
return to the straightforward way, smaller than r109351

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=113512&r1=113511&r2=113512&view=diff
==============================================================================
--- llvm/branches/ggreif/waymark-64/lib/VMCore/Use.cpp (original)
+++ llvm/branches/ggreif/waymark-64/lib/VMCore/Use.cpp Thu Sep  9 13:17:12 2010
@@ -51,52 +51,49 @@
 template <>
 const Use *Use::getImpliedUser<3>(const Use *Current) {
   while (true) {
-    int Tag = (Current++)->Prev.getInt() - stop64Tag;
+    unsigned Tag = (Current++)->Prev.getInt();
     ptrdiff_t Offset;
-		if (Tag == 0) {
-        switch (Current->Prev.getInt()) {
-          case 0: ++Current; Offset = 4; goto digits;
-          case xStop64Tag: ++Current; Offset = 1; goto digits;
-          case yStop64Tag: return Current + 3;
-				  default: Offset = 0; goto digits;
+    if (Tag & 4)
+    switch (Tag) {
+      case stop64Tag: {
+        PrevPtrTag nextTag = (Current++)->Prev.getInt();
+        switch (nextTag) {
+          case 0: Offset = 4; goto digits;
+          case xStop64Tag: Offset = 1; goto digits;
+          case yStop64Tag: return Current + 2;
+          default: Offset = nextTag; goto digits;
+        }
+      }
+      case xStop64Tag:
+        if (Current->Prev.getInt() == fullStop64Tag)
+          return Current + 1;
+        Offset = 1; goto digits;
+      case yStop64Tag:
+        if (Current->Prev.getInt() == xStop64Tag)
+          return Current + 2;
+        Offset = 2;
+        while (true) {
+          digits:
+          unsigned Tag = Current->Prev.getInt();
+          switch (Tag) {
+            case zero64Tag:
+            case one64Tag:
+            case two64Tag:
+            case three64Tag:
+              ++Current;
+              Offset = (Offset << 2) + Tag;
+              continue;
+            case xStop64Tag:
+              return Current + (Offset << 2) + one64Tag + 1;
+            default:
+              return Current + Offset;
+          }
         }
-		}
-		else if (Tag < 0)
-			continue;
-		else {
-			Tag -= 2;
-			if (Tag > 0)
-				return Current;
-			else if (Tag == 0) {
-				if (Current->Prev.getInt() == xStop64Tag)
-					return Current + 2;
-				Offset = 2;
-			}
-			else {
-				if (Current->Prev.getInt() == fullStop64Tag)
-					return Current + 1;
-				Offset = 1;
-			}
-
-			while (true) {
-				digits:
-						unsigned Tag = Current->Prev.getInt();
-						switch (Tag) {
-              case zero64Tag:
-              case one64Tag:
-              case two64Tag:
-              case three64Tag:
-                ++Current;
-                Offset = (Offset << 2) + Tag;
-                continue;
-              case xStop64Tag:
-                return Current + (Offset << 2) + one64Tag + 1;
-              default:
-                return Current + Offset;
-						}
-			}
-		}
-	}
+
+      case fullStop64Tag:
+        return Current;
+    }
+  }
 }
 
 template <>
@@ -253,7 +250,7 @@
 //===----------------------------------------------------------------------===//
 
 User *Use::getUser() const {
-  const Use *End = getImpliedUser();
+  const Use *End = getImpliedUser<availableTagBits>(this);
   const PointerIntPair<User*, 1, Tag>& ref(
                                 static_cast<const AugmentedUse*>(End - 1)->ref);
   User *She = ref.getPointer();





More information about the llvm-branch-commits mailing list