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

Duncan Sands baldrick at free.fr
Wed Nov 23 01:35:40 PST 2011

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

Ciao, Duncan.

More information about the llvm-commits mailing list