Types


ArrayType

CIR array type

Syntax:

!cir.array<
  mlir::Type,   # eltType
  uint64_t   # size
>

CIR.array represents C/C++ constant arrays.

Parameters:

Parameter C++ type Description
eltType mlir::Type  
size uint64_t  

BF16Type

CIR type that represents

Syntax: !cir.bf16

Floating-point type that represents the bfloat16 format.

BoolType

CIR bool type

cir.bool represent's C++ bool type.

ComplexType

CIR complex type

Syntax:

!cir.complex<
  mlir::Type   # elementTy
>

CIR type that represents a C complex number. cir.complex models the C type T _Complex.

The parameter elementTy gives the type of the real and imaginary part of the complex number. elementTy must be either a CIR integer type or a CIR floating-point type.

Parameters:

Parameter C++ type Description
elementTy mlir::Type  

DataMemberType

CIR type that represents pointer-to-data-member type in C++

Syntax:

!cir.data_member<
  mlir::Type,   # memberTy
  mlir::cir::StructType   # clsTy
>

cir.member_ptr models the pointer-to-data-member type in C++. Values of this type are essentially offsets of the pointed-to member within one of its containing struct.

Parameters:

Parameter C++ type Description
memberTy mlir::Type  
clsTy mlir::cir::StructType  

DoubleType

CIR double-precision float type

Syntax: !cir.double

Floating-point type that represents the double type in C/C++. Its underlying floating-point format is the IEEE-754 binar64 format.

ExceptionInfoType

CIR exception info

Syntax: !cir.exception

In presence of an inflight exception, this type holds all specific information for an exception: the associated type id, and the exception object pointer. These are materialzed from this type through other specific operations.

FP16Type

CIR type that represents IEEE-754 binary16 format

Syntax: !cir.f16

Floating-point type that represents the IEEE-754 binary16 format.

FP80Type

CIR type that represents x87 80-bit floating-point format

Syntax: !cir.f80

Floating-point type that represents the x87 80-bit floating-point format.

FuncType

CIR function type

Syntax:

!cir.func<
  ::llvm::ArrayRef<Type>,   # inputs
  Type,   # returnType
  bool   # varArg
>

The !cir.func is a function type. It consists of a single return type, a list of parameter types and can optionally be variadic.

Example:

!cir.func<!bool ()>
!cir.func<!s32i (!s8i, !s8i)>
!cir.func<!s32i (!s32i, ...)>

Parameters:

Parameter C++ type Description
inputs ::llvm::ArrayRef<Type>  
returnType Type  
varArg bool  

IntType

Integer type with arbitrary precision up to a fixed limit

CIR type that represents C/C++ primitive integer types. Said types are: char, short, int, long, long long, and their
unsigned variations.

Parameters:

Parameter C++ type Description
width unsigned  
isSigned bool  

LongDoubleType

CIR extended-precision float type

Syntax:

!cir.long_double<
  mlir::Type   # underlying
>

Floating-point type that represents the long double type in C/C++.

The underlying floating-point format of a long double value depends on the implementation. The underlying parameter specifies the CIR floating-point type that corresponds to this format. For now, it can only be either !cir.double or !cir.fp80.

Parameters:

Parameter C++ type Description
underlying mlir::Type  

MethodType

CIR type that represents C++ pointer-to-member-function type

Syntax:

!cir.method<
  mlir::cir::FuncType,   # memberFuncTy
  mlir::cir::StructType   # clsTy
>

cir.method models the pointer-to-member-function type in C++. The layout of this type is ABI-dependent.

Parameters:

Parameter C++ type Description
memberFuncTy mlir::cir::FuncType  
clsTy mlir::cir::StructType  

PointerType

CIR pointer type

Syntax:

!cir.ptr<
  mlir::Type,   # pointee
  mlir::Attribute   # addrSpace
>

CIR.ptr is a type returned by any op generating a pointer in C++.

Parameters:

Parameter C++ type Description
pointee mlir::Type  
addrSpace mlir::Attribute  

SingleType

CIR single-precision float type

Syntax: !cir.float

Floating-point type that represents the float type in C/C++. Its underlying floating-point format is the IEEE-754 binary32 format.

VectorType

CIR vector type

Syntax:

!cir.vector<
  mlir::Type,   # eltType
  uint64_t   # size
>

`cir.vector' represents fixed-size vector types. The parameters are the element type and the number of elements.

Parameters:

Parameter C++ type Description
eltType mlir::Type  
size uint64_t  

VoidType

CIR void type

Syntax: !cir.void

The !cir.void type represents the C/C++ void type.