FLANG
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
fir::ConvertFIRToLLVMPattern Class Reference
Inheritance diagram for fir::ConvertFIRToLLVMPattern:
fir::FIROpConversion< fir::CoordinateOp > fir::FIROpConversion< OP > fir::FIROpConversion< fir::EmboxOp > fir::FIROpConversion< fir::EmboxProcOp > fir::FIROpConversion< fir::FieldIndexOp > fir::FIROpConversion< fir::FirEndOp > fir::FIROpConversion< fir::GlobalOp > fir::FIROpConversion< fir::LoadOp > fir::FIROpConversion< fir::NoReassocOp > fir::FIROpConversion< fir::SelectCaseOp > fir::FIROpConversion< fir::SelectOp > fir::FIROpConversion< fir::SelectRankOp > fir::FIROpConversion< fir::SelectTypeOp > fir::FIROpConversion< fir::StoreOp > fir::FIROpConversion< fir::TypeDescOp > fir::FIROpConversion< fir::cg::XEmboxOp > fir::FIROpConversion< fir::cg::XReboxOp > fir::FIROpConversion< FromOp > fir::FIROpConversion< SourceOp >

Classes

struct  TypePair
 

Public Member Functions

 ConvertFIRToLLVMPattern (llvm::StringRef rootOpName, mlir::MLIRContext *context, const fir::LLVMTypeConverter &typeConverter, const fir::FIRToLLVMPassOptions &options, mlir::PatternBenefit benefit=1)
 

Protected Member Functions

mlir::Type convertType (mlir::Type ty) const
 
mlir::Type convertObjectType (mlir::Type firType) const
 
mlir::LLVM::ConstantOp genI32Constant (mlir::Location loc, mlir::ConversionPatternRewriter &rewriter, int value) const
 
mlir::LLVM::ConstantOp genConstantOffset (mlir::Location loc, mlir::ConversionPatternRewriter &rewriter, int offset) const
 
mlir::Value integerCast (mlir::Location loc, mlir::ConversionPatternRewriter &rewriter, mlir::Type ty, mlir::Value val, bool fold=false) const
 
TypePair getBoxTypePair (mlir::Type firBoxTy) const
 
mlir::Value getValueFromBox (mlir::Location loc, TypePair boxTy, mlir::Value box, mlir::Type resultTy, mlir::ConversionPatternRewriter &rewriter, int boxValue) const
 Construct code sequence to extract the specific value from a fir.box.
 
llvm::SmallVector< mlir::Value, 3 > getDimsFromBox (mlir::Location loc, llvm::ArrayRef< mlir::Type > retTys, TypePair boxTy, mlir::Value box, mlir::Value dim, mlir::ConversionPatternRewriter &rewriter) const
 
llvm::SmallVector< mlir::Value, 3 > getDimsFromBox (mlir::Location loc, llvm::ArrayRef< mlir::Type > retTys, TypePair boxTy, mlir::Value box, int dim, mlir::ConversionPatternRewriter &rewriter) const
 
mlir::Value loadDimFieldFromBox (mlir::Location loc, TypePair boxTy, mlir::Value box, mlir::Value dim, int off, mlir::Type ty, mlir::ConversionPatternRewriter &rewriter) const
 
mlir::Value getDimFieldFromBox (mlir::Location loc, TypePair boxTy, mlir::Value box, int dim, int off, mlir::Type ty, mlir::ConversionPatternRewriter &rewriter) const
 
mlir::Value getStrideFromBox (mlir::Location loc, TypePair boxTy, mlir::Value box, unsigned dim, mlir::ConversionPatternRewriter &rewriter) const
 
mlir::Value getBaseAddrFromBox (mlir::Location loc, TypePair boxTy, mlir::Value box, mlir::ConversionPatternRewriter &rewriter) const
 Read base address from a fir.box. Returned address has type ty.
 
mlir::Value getElementSizeFromBox (mlir::Location loc, mlir::Type resultTy, TypePair boxTy, mlir::Value box, mlir::ConversionPatternRewriter &rewriter) const
 
mlir::Value getRankFromBox (mlir::Location loc, TypePair boxTy, mlir::Value box, mlir::ConversionPatternRewriter &rewriter) const
 Read base address from a fir.box. Returned address has type ty.
 
mlir::Value getExtraFromBox (mlir::Location loc, TypePair boxTy, mlir::Value box, mlir::ConversionPatternRewriter &rewriter) const
 Read the extra field from a fir.box.
 
mlir::Type getBoxEleTy (mlir::Type type, llvm::ArrayRef< std::int64_t > indexes) const
 
mlir::Type getLlvmObjectTypeFromBoxType (mlir::Type boxType) const
 
mlir::Value loadTypeDescAddress (mlir::Location loc, TypePair boxTy, mlir::Value box, mlir::ConversionPatternRewriter &rewriter) const
 Read the address of the type descriptor from a box.
 
mlir::Value genBoxAttributeCheck (mlir::Location loc, TypePair boxTy, mlir::Value box, mlir::ConversionPatternRewriter &rewriter, unsigned maskValue) const
 
mlir::Value computeBoxSize (mlir::Location, TypePair boxTy, mlir::Value box, mlir::ConversionPatternRewriter &rewriter) const
 
template<typename... ARGS>
mlir::LLVM::GEPOp genGEP (mlir::Location loc, mlir::Type ty, mlir::ConversionPatternRewriter &rewriter, mlir::Value base, ARGS... args) const
 
mlir::Block * getBlockForAllocaInsert (mlir::Operation *op, mlir::Region *parentRegion) const
 
mlir::Value genAllocaAndAddrCastWithType (mlir::Location loc, mlir::Type llvmObjectTy, unsigned alignment, mlir::ConversionPatternRewriter &rewriter) const
 
const fir::LLVMTypeConverterlowerTy () const
 
void attachTBAATag (mlir::LLVM::AliasAnalysisOpInterface op, mlir::Type baseFIRType, mlir::Type accessFIRType, mlir::LLVM::GEPOp gep) const
 
unsigned getAllocaAddressSpace (mlir::ConversionPatternRewriter &rewriter) const
 
unsigned getProgramAddressSpace (mlir::ConversionPatternRewriter &rewriter) const
 

Protected Attributes

const fir::FIRToLLVMPassOptionsoptions
 

Member Function Documentation

◆ computeBoxSize()

mlir::Value fir::ConvertFIRToLLVMPattern::computeBoxSize ( mlir::Location  loc,
TypePair  boxTy,
mlir::Value  box,
mlir::ConversionPatternRewriter &  rewriter 
) const
protected

Compute the descriptor size in bytes. The result is not guaranteed to be a compile time constant if the box is for an assumed rank, in which case the box rank will be read.

◆ getDimsFromBox()

llvm::SmallVector< mlir::Value, 3 > fir::ConvertFIRToLLVMPattern::getDimsFromBox ( mlir::Location  loc,
llvm::ArrayRef< mlir::Type >  retTys,
TypePair  boxTy,
mlir::Value  box,
mlir::Value  dim,
mlir::ConversionPatternRewriter &  rewriter 
) const
protected

Method to construct code sequence to get the triple for dimension dim from a box.

◆ integerCast()

mlir::Value fir::ConvertFIRToLLVMPattern::integerCast ( mlir::Location  loc,
mlir::ConversionPatternRewriter &  rewriter,
mlir::Type  ty,
mlir::Value  val,
bool  fold = false 
) const
protected

Perform an extension or truncation as needed on an integer value. Lowering to the specific target may involve some sign-extending or truncation of values, particularly to fit them from abstract box types to the appropriate reified structures.


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