MLIR  19.0.0git
Public Member Functions | Public Attributes | List of all members
mlir::LLVM::detail::LoopAnnotationImporter Class Reference

A helper class that converts llvm.loop metadata nodes into corresponding LoopAnnotationAttrs and llvm.access.group nodes into AccessGroupAttrs. More...

#include "Target/LLVMIR/LoopAnnotationImporter.h"

Public Member Functions

 LoopAnnotationImporter (ModuleImport &moduleImport, OpBuilder &builder)
 
LoopAnnotationAttr translateLoopAnnotation (const llvm::MDNode *node, Location loc)
 
LogicalResult translateAccessGroup (const llvm::MDNode *node, Location loc)
 Converts all LLVM access groups starting from node to MLIR access group attributes. More...
 
FailureOr< SmallVector< AccessGroupAttr > > lookupAccessGroupAttrs (const llvm::MDNode *node) const
 Returns the access group attribute that map to the access group nodes starting from the access group metadata node. More...
 

Public Attributes

ModuleImportmoduleImport
 The ModuleImport owning this instance. More...
 

Detailed Description

A helper class that converts llvm.loop metadata nodes into corresponding LoopAnnotationAttrs and llvm.access.group nodes into AccessGroupAttrs.

Definition at line 26 of file LoopAnnotationImporter.h.

Constructor & Destructor Documentation

◆ LoopAnnotationImporter()

mlir::LLVM::detail::LoopAnnotationImporter::LoopAnnotationImporter ( ModuleImport moduleImport,
OpBuilder builder 
)
inline

Definition at line 28 of file LoopAnnotationImporter.h.

Member Function Documentation

◆ lookupAccessGroupAttrs()

FailureOr< SmallVector< AccessGroupAttr > > LoopAnnotationImporter::lookupAccessGroupAttrs ( const llvm::MDNode *  node) const

Returns the access group attribute that map to the access group nodes starting from the access group metadata node.

Returns failure, if any of the attributes cannot be found.

Definition at line 515 of file LoopAnnotationImporter.cpp.

References mlir::failure().

◆ translateAccessGroup()

LogicalResult LoopAnnotationImporter::translateAccessGroup ( const llvm::MDNode *  node,
Location  loc 
)

Converts all LLVM access groups starting from node to MLIR access group attributes.

It stores a mapping from every nested access group node to the translated attribute. Returns success if all conversions succeed and failure otherwise.

Definition at line 487 of file LoopAnnotationImporter.cpp.

References mlir::emitWarning(), mlir::failure(), mlir::Builder::getAttr(), and mlir::success().

◆ translateLoopAnnotation()

LoopAnnotationAttr LoopAnnotationImporter::translateLoopAnnotation ( const llvm::MDNode *  node,
Location  loc 
)

Definition at line 469 of file LoopAnnotationImporter.cpp.

Member Data Documentation

◆ moduleImport

ModuleImport& mlir::LLVM::detail::LoopAnnotationImporter::moduleImport

The ModuleImport owning this instance.

Definition at line 46 of file LoopAnnotationImporter.h.


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