[llvm-commits] [llvm] r108695 - /llvm/trunk/lib/VMCore/Use.cpp

Gabor Greif ggreif at gmail.com
Mon Jul 19 09:47:07 PDT 2010



On Jul 19, 6:27 pm, Chris Lattner <clatt... at apple.com> wrote:
> On Jul 19, 2010, at 7:48 AM, Gabor Greif wrote:
>
> > Author: ggreif
> > Date: Mon Jul 19 09:48:15 2010
> > New Revision: 108695
>
> > URL:http://llvm.org/viewvc/llvm-project?rev=108695&view=rev
> > Log:
> > precompute 20 tags
>
> Hi Gabor,
>
> What does this do?

It does fill the "waymarks" into the Use array according to
this description: <http://llvm.org/docs/
ProgrammersManual.html#UserLayout>.
These are needed to find the User's 'this' pointer.

Previously we have dynamically computed the waymarks for all Use
objects,
now we quickly fetch the marks for up to 20 Use objects, and then we
fall
back to the old algo to fill in the rest (by computing the marks
dynamically).

My benchmarks show a 0.5% speedup on "opt 403.gcc.bc -std-compile-opts
-disable-output"
when going to 0 -> 20 precomputed tags. I did not measure pure .bc-
loading where
the effect is probably much more prominent.

Cheers,

   Gabor

>
> -Chris
>
>
>
>
>
> > Modified:
> >    llvm/trunk/lib/VMCore/Use.cpp
>
> > Modified: llvm/trunk/lib/VMCore/Use.cpp
> > URL:http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Use.cpp?rev...
> > ==============================================================================
> > --- llvm/trunk/lib/VMCore/Use.cpp (original)
> > +++ llvm/trunk/lib/VMCore/Use.cpp Mon Jul 19 09:48:15 2010
> > @@ -86,11 +86,17 @@
> > //===----------------------------------------------------------------------===//
>
> > Use *Use::initTags(Use * const Start, Use *Stop, ptrdiff_t Done) {
> > -  while (Done < 6) {
> > +  while (Done < 20) {
> >     if (Start == Stop--)
> >       return Start;
> > -    static const PrevPtrTag tags[6] = { fullStopTag, oneDigitTag, stopTag,
> > -                                        oneDigitTag, oneDigitTag, stopTag };
> > +    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
> > +                                       };
> >     Stop->Prev.setFromOpaqueValue(reinterpret_cast<Use**>(tags[Done++]));
> >     Stop->Val = 0;
> >   }
>
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-comm... at cs.uiuc.edu
> >http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
> _______________________________________________
> llvm-commits mailing list
> llvm-comm... at cs.uiuc.eduhttp://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list