llvm::toVectorizedTy

Convert a scalar or struct type to its vectorized form.

Synopsis

Declared in <llvm/IR/VectorTypeUtils.h>

Type*
toVectorizedTy(
    Type* Ty,
    ElementCount EC);

Description

For scalar types, this is equivalent to calling toVectorTy. For struct types, this returns a new struct where each element type has been widened to a vector type. Note:

  • If the incoming type is void, we return void

  • If EC is scalar, Ty is returned unchanged

  • Only unpacked literal struct types are supported

Return Value

The vectorized form of Ty for element count EC.

Parameters

NameDescription
TyScalar, void, or unpacked literal struct type to widen.
ECElement count used to widen Ty.