[llvm-commits] Vectors of Pointers and Vector-GEP

Hal Finkel hfinkel at anl.gov
Wed Nov 23 05:42:56 PST 2011

On Wed, 2011-11-23 at 10:35 +0100, Duncan Sands wrote:
> Hi Nadav,
> > Following the discussion in last week’s LLVM developers conference I started
> > working on support for vectors-of-pointers. Vectors of pointers are needed for
> > supporting scatter/gather operations and are the first step in the direction of
> > supporting predicated architectures. In the attached patch, I change the LLVM-IR
> > in order to support vectors-of-pointers and added basic support for vector-gep.
> > In following patches I plan to extend the vector-gep support to more indices and
> > add scatter/gather intrinsics.
> one of the issues with vectors-of-pointers is then you can no longer say what
> the size of a vector is without target data, since you don't know what the size
> of a pointer is without target data.  Methods like VectorType::getBitWidth will
> have to be deleted.  Methods like VectorType::getTruncatedElementVectorType,
> VectorType::getExtendedElementVectorType and VectorType::getInteger will need to
> either be removed, or changed to take a target data parameter (which is probably
> a layering violation, so they would need to be moved elsewhere).  The PtrToInt
> and IntToPtr operations will need to be enhanced to work on vectors, and a
> bunch of places that bitcast vectors will need to become more careful, in case
> they are trying to bitcast between a vector of pointers and a vector of
> integers.

getExtendedElementVectorType, etc. don't "work" for floating-point
vectors currently, so there is some precedent for this kind of thing.

Another option would be to make another derived type for pointer


> Ciao, Duncan.
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Hal Finkel
Postdoctoral Appointee
Leadership Computing Facility
Argonne National Laboratory

More information about the llvm-commits mailing list