[llvm-branch-commits] [llvm-branch] r197162 - use a precomputed word full of tags, passes tests, cleanup pending

Gabor Greif ggreif at gmail.com
Thu Dec 12 08:00:41 PST 2013


Author: ggreif
Date: Thu Dec 12 10:00:41 2013
New Revision: 197162

URL: http://llvm.org/viewvc/llvm-project?rev=197162&view=rev
Log:
use a precomputed word full of tags, passes tests, cleanup pending

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

Modified: llvm/branches/ggreif/waymark-64-new/lib/IR/Use.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/waymark-64-new/lib/IR/Use.cpp?rev=197162&r1=197161&r2=197162&view=diff
==============================================================================
--- llvm/branches/ggreif/waymark-64-new/lib/IR/Use.cpp (original)
+++ llvm/branches/ggreif/waymark-64-new/lib/IR/Use.cpp Thu Dec 12 10:00:41 2013
@@ -91,15 +91,15 @@ Use *Use::initTags(Use * const Start, Us
   while (Done < 20) {
     if (Start == Stop--)
       return Start;
-    static const PrevPtrTag tags[20] = { fullStopTag, oneDigitTag, stopTag,
-                                         oneDigitTag, oneDigitTag, stopTag,
-                                         zeroDigitTag, oneDigitTag, oneDigitTag,
-                                         stopTag, zeroDigitTag, oneDigitTag,
-                                         zeroDigitTag, oneDigitTag, stopTag,
-                                         oneDigitTag, oneDigitTag, oneDigitTag,
-                                         oneDigitTag, stopTag
-                                       };
-    new(Stop) Use(tags[Done++]);
+    static const unsigned long tags =
+      (unsigned long)fullStopTag << 38 | (unsigned long)oneDigitTag << 36 | (unsigned long)stopTag << 34 |
+      (unsigned long)oneDigitTag << 32 | oneDigitTag << 30 | stopTag << 28 |
+      zeroDigitTag << 26 | oneDigitTag << 24 | oneDigitTag << 22 |
+      stopTag << 20 | zeroDigitTag << 18 | oneDigitTag << 16 |
+      zeroDigitTag << 14 | oneDigitTag << 12 | stopTag << 10 |
+      oneDigitTag << 8 | oneDigitTag << 6 | oneDigitTag << 4 |
+      oneDigitTag << 2 | stopTag;
+    new(Stop) Use(PrevPtrTag((tags >> (19 - Done++) * 2) & 0x3));
   }
 
   ptrdiff_t Count = Done;





More information about the llvm-branch-commits mailing list