[llvm-branch-commits] [llvm-branch] r201993 - WIP: also start with initTags<8>
Gabor Greif
ggreif at gmail.com
Sun Feb 23 13:23:45 PST 2014
Author: ggreif
Date: Sun Feb 23 15:23:45 2014
New Revision: 201993
URL: http://llvm.org/viewvc/llvm-project?rev=201993&view=rev
Log:
WIP: also start with initTags<8>
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=201993&r1=201992&r2=201993&view=diff
==============================================================================
--- llvm/branches/ggreif/waymark-64-new/lib/IR/Use.cpp (original)
+++ llvm/branches/ggreif/waymark-64-new/lib/IR/Use.cpp Sun Feb 23 15:23:45 2014
@@ -131,13 +131,13 @@ const Use *Use::getImpliedUser<8>() cons
//===----------------------------------------------------------------------===//
template<>
-Use *Use::initTags<8>(Use * const Start, Use *Stop) {
+Use *Use::initTags<4>(Use * const Start, Use *Stop) {
ptrdiff_t Done = 0;
while (Done < 32) {
if (Start == Stop--)
return Start;
-# define TAG_AT(N, TAG) ((unsigned long)(TAG ## Tag) << ((N) * 2))
- static const unsigned long tags =
+# define TAG_AT(N, TAG) (uintptr_t(TAG ## Tag) << ((N) * 2))
+ static const uintptr_t tags =
TAG_AT(0, fullStop) | TAG_AT(1, oneDigit) | TAG_AT(2, stop) |
TAG_AT(3, oneDigit) | TAG_AT(4, oneDigit) | TAG_AT(5, stop) |
TAG_AT(6, zeroDigit) | TAG_AT(7, oneDigit) | TAG_AT(8, oneDigit) |
@@ -170,6 +170,42 @@ Use *Use::initTags<8>(Use * const Start,
return Start;
}
+template<>
+Use *Use::initTags<8>(Use * const Start, Use *Stop) {
+ ptrdiff_t Done = 0;
+ while (Done < 17) {
+ if (Start == Stop--)
+ return Start;
+# define TAG_AT(N, TAG) (uintptr_t(TAG ## Tag3) << ((N) * 3))
+ static const uintptr_t tags =
+ TAG_AT(0, fullStop) | TAG_AT(1, stop) | TAG_AT(2, skipStop) |
+ TAG_AT(3, oneOneDigit) | TAG_AT(4, stop) | TAG_AT(5, skipStop) |
+ TAG_AT(6, skip2Stop) | TAG_AT(7, oneOneDigit) | TAG_AT(8, zeroOneDigit) |
+ TAG_AT(9, stop) | TAG_AT(10, skipStop) | TAG_AT(11, skip2Stop) |
+ TAG_AT(12, zeroZeroDigit) | TAG_AT(13, oneOneDigit) | TAG_AT(14, stop) |
+ TAG_AT(15, skipStop) | TAG_AT(16, skip2Stop);
+# undef TAG_AT
+ new(Stop) Use(PrevPtrTag((tags >> Done++ * 2) & 0x3));
+ }
+
+ ptrdiff_t Count = Done;
+ while (Start != Stop) {
+ --Stop;
+ if (!Count) {
+ new(Stop) Use(stopTag3);
+ ++Done;
+ Count = Done;
+ } else {
+ new(Stop) Use(Tag3(zeroOneDigitTag3 | (Count & 0x3)));
+ Count >>= 2;
+ ++Done;
+ }
+ }
+
+ return Start;
+}
+
+
//===----------------------------------------------------------------------===//
// Use zap Implementation
//===----------------------------------------------------------------------===//
More information about the llvm-branch-commits
mailing list