[llvm-commits] [llvm] r49401 - in /llvm/branches/ggreif/use-diet: include/llvm/User.h lib/VMCore/Use.cpp
Gabor Greif
ggreif at gmail.com
Tue Apr 8 14:22:37 PDT 2008
Author: ggreif
Date: Tue Apr 8 16:22:23 2008
New Revision: 49401
URL: http://llvm.org/viewvc/llvm-project?rev=49401&view=rev
Log:
use the fact that 's' is always followed by '1' to peel off one memory access when decoding
Modified:
llvm/branches/ggreif/use-diet/include/llvm/User.h
llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp
Modified: llvm/branches/ggreif/use-diet/include/llvm/User.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/User.h?rev=49401&r1=49400&r2=49401&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/include/llvm/User.h (original)
+++ llvm/branches/ggreif/use-diet/include/llvm/User.h Tue Apr 8 16:22:23 2008
@@ -110,7 +110,7 @@
Only the significant number of bits need to be stored between the
-stops, so that the worst case is 21 memory accesses when there are
+stops, so that the worst case is 20 memory accesses when there are
1000 Use objects.
The following literate Haskell fragment demonstrates the concept:
@@ -141,7 +141,7 @@
> pref :: [Char] -> Int
> pref "S" = 1
-> pref ('s':rest) = decode 1 0 rest
+> pref ('s':'1':rest) = decode 2 1 rest
> pref (_:rest) = 1 + pref rest
>
> decode walk acc ('0':rest) = decode (walk + 1) (acc * 2) rest
Modified: llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp?rev=49401&r1=49400&r2=49401&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp (original)
+++ llvm/branches/ggreif/use-diet/lib/VMCore/Use.cpp Tue Apr 8 16:22:23 2008
@@ -23,7 +23,7 @@
const Use *Use::getImpliedUser() const {
bool StopEncountered = false;
- ptrdiff_t Offset = 0;
+ ptrdiff_t Offset = 1;
const Use *Current = this;
while (true) {
@@ -39,7 +39,8 @@
if (StopEncountered)
return Current + Offset;
StopEncountered = true;
- break;
+ Current += 2;
+ continue;
case fullStopTag:
return Current + 1;
}
More information about the llvm-commits
mailing list