[llvm-commits] [llvm] r57641 - in /llvm/trunk: include/llvm/Use.h lib/VMCore/Use.cpp

Gabor Greif ggreif at gmail.com
Fri Oct 17 09:22:15 PDT 2008


On Oct 17, 5:15 pm, Chris Lattner <clatt... at apple.com> wrote:
> On Oct 17, 2008, at 1:42 AM, Gabor Greif wrote:
>
> >>> Notably this approach does not catch dereferencing of tagged
> >>> pointers, but helps
> >>> in separating the two concepts a bit.
>
> >> Gabor, this is very interesting, but it is very subtle and definitely
> >> needs some comments in the code.  Please add them.
>
> > Hmmm, I am specialized on subtle things :-)
> > I was so happy yesterday that this scheme worked out with minimal
> > changes that I have completely forgotten documenting it. I have just
> > added some lines, but I am not sure how these can find their way into
> > doxygen. Anybody?
>
> Thanks Gabor, I'm not too concerned about doxygenating the comments,  
> but if someone wanted to figure that out, it would be fine.
>
> On another topic, in Clang we usually represent type tagged pointers  
> as intptr_t members instead of foo*'s.  The accessor that extracts the  
> pointer from the intptr_t just does a cast to foo* after masking out  
> the bits.  Would this be better than using volatile?

Definitely not. The underlying type T* allows the selection of the
templated
tagging/untagging functions. I have some plans to use 3-bit tags on 64-
bit
platforms, to significantly speed up the algorithms. These would use a
template
mechanism to select the more efficient algos at compile-time.

I would rather suggest that Clang migrates to the Use.h-style tagging
if
feasible :-)

Btw. if SROA could be taken for granted in all compilers, I would have
used Tagged<T*> instead of T volatile*. But I think the current
approach
is sufficiently elegant (with the bit of comment I have added).

Cheers,

    Gabor

>
> -Chris
> _______________________________________________
> 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