CGRAOmp  0.1
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
CGRAOmp::CustomInstMapEntry Class Reference

A derived class from InstMapEntry for custom instruction. More...

#include <CGRAInstMap.hpp>

Inheritance diagram for CGRAOmp::CustomInstMapEntry:
CGRAOmp::InstMapEntry

Public Member Functions

 CustomInstMapEntry (StringRef func_name, ModuleAnalysisManager &MAM)
 Construct a new CustomIns MapEntry object. More...
 
 CustomInstMapEntry (StringRef func_name, ModuleAnalysisManager &MAM, MapCondition *map_cond)
 Construct a new CustomInstMapEntry object with an initial MapCondition instance. More...
 
bool match (Instruction *I)
 Derived function from InstMapEntry::match specilized for custom instruction. More...
 
- Public Member Functions inherited from CGRAOmp::InstMapEntry
 InstMapEntry (StringRef opcode, InstMapKind Kind)
 Construct a new InstMapEntry object. More...
 
 InstMapEntry (StringRef opcode, InstMapKind Kind, MapCondition *cond)
 Construct a new InstMapEntry object with an initial MapCondition instance. More...
 
 ~InstMapEntry ()
 
void addMapping (MapCondition *cond)
 set a mapping condition More...
 
virtual bool match (StringRef opcode)
 check this entry is for the specified instruction This will not check the mapping condition. More...
 
virtual std::string getMapName ()
 get the map name of this entry More...
 
void print (raw_ostream &OS)
 
void dump ()
 
InstMapKind getKind () const
 

Static Public Member Functions

static bool classof (const InstMapEntry *imap)
 

Static Public Attributes

static constexpr InstMapEntry::InstMapKind CustomOp
 

Private Member Functions

bool isCustomOpFunc (Function *F)
 

Private Attributes

ModuleAnalysisManager & MAM
 

Additional Inherited Members

- Public Types inherited from CGRAOmp::InstMapEntry
enum  InstMapKind {
  InstMapKind::BinaryOp, InstMapKind::CompOp, InstMapKind::MemOp, InstMapKind::CustomOp,
  InstMapKind::OtherOp
}
 
- Protected Attributes inherited from CGRAOmp::InstMapEntry
MapConditionmap_cond
 
std::string opcode_str
 

Detailed Description

A derived class from InstMapEntry for custom instruction.

Constructor & Destructor Documentation

◆ CustomInstMapEntry() [1/2]

CGRAOmp::CustomInstMapEntry::CustomInstMapEntry ( StringRef  func_name,
ModuleAnalysisManager &  MAM 
)
inline

Construct a new CustomIns MapEntry object.

Parameters
func_namea function name correspoinding to the custom instruction
MAMModuleAnalysisManager

◆ CustomInstMapEntry() [2/2]

CGRAOmp::CustomInstMapEntry::CustomInstMapEntry ( StringRef  func_name,
ModuleAnalysisManager &  MAM,
MapCondition map_cond 
)
inline

Construct a new CustomInstMapEntry object with an initial MapCondition instance.

Parameters
func_namea function name correspoinding to the custom instruction
MAMModuleAnalysisManager
condmapping condition

Member Function Documentation

◆ classof()

static bool CGRAOmp::CustomInstMapEntry::classof ( const InstMapEntry imap)
inlinestatic

◆ isCustomOpFunc()

bool CustomInstMapEntry::isCustomOpFunc ( Function *  F)
private

◆ match()

bool CustomInstMapEntry::match ( Instruction *  I)
virtual

Derived function from InstMapEntry::match specilized for custom instruction.

the function corresponding to the custom instruction must satisfy the following conditions

  1. the function name is the same as the opcode of the custom instruction
  2. the function is annotated with "cgra_custom_inst"

The following declaration is an example to annotate a function:

__attribute__((annotate("cgra_custom_inst"))) int func(int x, int y);

Implements CGRAOmp::InstMapEntry.

Member Data Documentation

◆ CustomOp

constexpr InstMapEntry::InstMapKind CGRAOmp::CustomInstMapEntry::CustomOp
staticconstexpr

◆ MAM

ModuleAnalysisManager& CGRAOmp::CustomInstMapEntry::MAM
private

The documentation for this class was generated from the following files:
CGRAOmp::InstMapEntry::InstMapKind::CustomOp
@ CustomOp