[llvm-commits] [llvm] r58326 - /llvm/branches/ggreif/use-diet/lib/VMCore/getValue.cpp

Gabor Greif ggreif at gmail.com
Tue Oct 28 04:57:54 PDT 2008


Author: ggreif
Date: Tue Oct 28 06:57:54 2008
New Revision: 58326

URL: http://llvm.org/viewvc/llvm-project?rev=58326&view=rev
Log:
move checks for exit conditions to a better place
eliminate tabs

Modified:
    llvm/branches/ggreif/use-diet/lib/VMCore/getValue.cpp

Modified: llvm/branches/ggreif/use-diet/lib/VMCore/getValue.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/VMCore/getValue.cpp?rev=58326&r1=58325&r2=58326&view=diff

==============================================================================
--- llvm/branches/ggreif/use-diet/lib/VMCore/getValue.cpp (original)
+++ llvm/branches/ggreif/use-diet/lib/VMCore/getValue.cpp Tue Oct 28 06:57:54 2008
@@ -99,7 +99,7 @@
           case Use::fullStopTagN:
               return reinterpret_cast<Value*>(Next);
           case Use::stopTagN: {
-	      goto efficiency;
+              goto efficiency;
           }
           default:
               Acc = (Acc << 1) | (Tag & 1);
@@ -122,17 +122,10 @@
         // try to pick up exactly requiredSteps digits
         int digits = requiredSteps;
         Acc = 0;
-	Use* Tagspace = 0;
+        Use* Tagspace = 0;
         Use* Orig(Next);
 
         while (1) {
-	    if (!digits) {
-	        if (Tagspace && Cushion <= -requiredSteps) {
-		    punchAwayDigits(Orig->Prev);
-		    repaintByCopying(Tagspace, Orig);
-	        }
-                return reinterpret_cast<Value*>(Acc << spareBits);
-	    }
             Next = Next->Next;
             __builtin_prefetch(Next);
             --Cushion;
@@ -152,21 +145,28 @@
                     goto efficiency;
                 }
                 default:
-		    if (!Tagspace) {
-		        Tagspace = Orig;
-			// Exploit the fact that a pointer to Use::Next
-			// is identical to the pointer to the previous Use.
-			// This is a mild hack assuming Use::Next being the
-			// first member. At this point we can be certain
-			// that U->Prev points into a Use, because we have
-			// already seen a stop tag (precondition).
-			Orig = (Use*)stripTag<Use::tagMask>(U->Prev);
-		    }
+                    if (!Tagspace) {
+                        Tagspace = Orig;
+                        // Exploit the fact that a pointer to Use::Next
+                        // is identical to the pointer to the previous Use.
+                        // This is a mild hack assuming Use::Next being the
+                        // first member. At this point we can be certain
+                        // that U->Prev points into a Use, because we have
+                        // already seen a stop tag (precondition).
+                        Orig = (Use*)stripTag<Use::tagMask>(U->Prev);
+                    }
                     --digits;
                     Acc = (Acc << 1) | (Tag & 1);
                     if (Cushion <= 0) {
                         U = stripTag<Use::tagMaskN>(U->Next);
                     }
+                    if (!digits) {
+                      if (Tagspace && Cushion <= -requiredSteps) {
+                        punchAwayDigits(Orig->Prev);
+                        repaintByCopying(Tagspace, Orig);
+                      }
+                      return reinterpret_cast<Value*>(Acc << spareBits);
+                    }
                     continue;
             }
             break;
@@ -200,12 +200,6 @@
         Use *Tagspace(Next);
 
         while (1) {
-            if (!digits) {
-                punchAwayDigits(U->Prev);
-                repaintByCopying(Tagspace, U);
-                return reinterpret_cast<Value*>(Acc << spareBits);
-            }
-
             Next = Next->Next;
             __builtin_prefetch(Next);
             U = stripTag<Use::tagMaskN>(U->Next);
@@ -223,6 +217,11 @@
                 default:
                     --digits;
                     Acc = (Acc << 1) | (Tag & 1);
+                    if (!digits) {
+                      punchAwayDigits(U->Prev);
+                      repaintByCopying(Tagspace, U);
+                      return reinterpret_cast<Value*>(Acc << spareBits);
+                    }
                     continue;
             }
             break;





More information about the llvm-commits mailing list