MLIR  16.0.0git
Public Member Functions | Static Public Member Functions | List of all members
mlir::DataDescriptor Class Reference

Helper class to produce LLVM dialect operations inserting elements to a Data descriptor. More...

#include "mlir/Conversion/OpenACCToLLVM/ConvertOpenACCToLLVM.h"

+ Inheritance diagram for mlir::DataDescriptor:
+ Collaboration diagram for mlir::DataDescriptor:

Public Member Functions

 DataDescriptor (Value descriptor)
 Construct a helper for the given descriptor value. More...
 
void setPointer (OpBuilder &builder, Location loc, Value ptr)
 Builds IR inserting the pointer value into the descriptor. More...
 
void setBasePointer (OpBuilder &builder, Location loc, Value basePtr)
 Builds IR inserting the base pointer value into the descriptor. More...
 
void setSize (OpBuilder &builder, Location loc, Value size)
 Builds IR inserting the size value into the descriptor. More...
 
- Public Member Functions inherited from mlir::StructBuilder
 StructBuilder (Value v)
 Construct a helper for the given value. More...
 
 operator Value ()
 

Static Public Member Functions

static DataDescriptor undef (OpBuilder &builder, Location loc, Type basePtrTy, Type ptrTy)
 Builds IR creating an undef value of the descriptor type. More...
 
static bool isValid (Value descriptor)
 Check whether the type is a valid data descriptor. More...
 
- Static Public Member Functions inherited from mlir::StructBuilder
static StructBuilder undef (OpBuilder &builder, Location loc, Type descriptorType)
 Builds IR creating an undef value of the descriptor type. More...
 

Additional Inherited Members

- Protected Member Functions inherited from mlir::StructBuilder
Value extractPtr (OpBuilder &builder, Location loc, unsigned pos)
 Builds IR to extract a value from the struct at position pos. More...
 
void setPtr (OpBuilder &builder, Location loc, unsigned pos, Value ptr)
 Builds IR to set a value in the struct at position pos. More...
 
- Protected Attributes inherited from mlir::StructBuilder
Value value
 
Type structType
 

Detailed Description

Helper class to produce LLVM dialect operations inserting elements to a Data descriptor.

Wraps a Value pointing to the descriptor. The Value may be null, in which case none of the operations are valid.

The data descriptor holds information needed to perform data operations and movements with the runtime. BasePointer: base of the pointer being mapped. Pointer: actual pointer of the data being mapped. Size: size of the data being mapped.

Example:

struct S {
int x;
int y;
};

Mapping s.y will result if the following information in the data descriptor:

For a scalar variable BasePointer and Pointer will be the same.

Definition at line 54 of file ConvertOpenACCToLLVM.h.

Constructor & Destructor Documentation

◆ DataDescriptor()

DataDescriptor::DataDescriptor ( Value  descriptor)
explicit

Construct a helper for the given descriptor value.

Definition at line 31 of file OpenACCToLLVM.cpp.

References mlir::StructBuilder::value.

Referenced by undef().

Member Function Documentation

◆ isValid()

bool DataDescriptor::isValid ( Value  descriptor)
static

◆ setBasePointer()

void DataDescriptor::setBasePointer ( OpBuilder builder,
Location  loc,
Value  basePtr 
)

Builds IR inserting the base pointer value into the descriptor.

Definition at line 62 of file OpenACCToLLVM.cpp.

References mlir::kPtrBasePosInDataDescriptor, and mlir::StructBuilder::setPtr().

◆ setPointer()

void DataDescriptor::setPointer ( OpBuilder builder,
Location  loc,
Value  ptr 
)

Builds IR inserting the pointer value into the descriptor.

Definition at line 68 of file OpenACCToLLVM.cpp.

References mlir::kPtrPosInDataDescriptor, and mlir::StructBuilder::setPtr().

◆ setSize()

void DataDescriptor::setSize ( OpBuilder builder,
Location  loc,
Value  size 
)

◆ undef()

DataDescriptor DataDescriptor::undef ( OpBuilder builder,
Location  loc,
Type  basePtrTy,
Type  ptrTy 
)
static

Builds IR creating an undef value of the descriptor type.

Builds IR creating an undef value of the data descriptor.

Definition at line 36 of file OpenACCToLLVM.cpp.

References mlir::OpBuilder::create(), DataDescriptor(), mlir::Builder::getContext(), mlir::Builder::getI64Type(), mlir::LLVM::LLVMStructType::getNewIdentified(), and getStructName().

Referenced by setSize().


The documentation for this class was generated from the following files: