CGRAOmp  0.1
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
CGRAOmp Namespace Reference

Namespaces

 Utils
 

Classes

class  AddressGenerator
 An abstract class representing a type of address generator. More...
 
class  AffineAG
 A model of address generator compatible to memory access with affine expression the accessed memory address must be expressed in. More...
 
class  AffineAGCompatibility
 A derived class from AGCompatibility for affine AGs. More...
 
class  AGCompatibility
 A derived class from VerifyResultBase describing whether the memory access pattern is compatible with the AGs or not. More...
 
class  AnnotationAnalysisPass
 Function Pass to analyze which annotations the function has. More...
 
class  BalanceTree
 A DFGPass to balance the tree structure. More...
 
class  BinaryOpMapEntry
 A derived class from InstMapEntry for BinaryOperation. More...
 
class  CGRAModel
 A base class of CGRA model for DFG extraction. More...
 
class  CompOpMapEntry
 A derived class from InstMapEntry for comparison instructions. More...
 
class  CustomInstMapEntry
 A derived class from InstMapEntry for custom instruction. More...
 
class  DecoupledAnalysis
 An analysis result of memory access decoupling for loop kernel. More...
 
class  DecoupledAnalysisPass
 A loop pass to analyze memory access for decoupling. More...
 
class  DecoupledCGRA
 CGRA model for category "decoupled". More...
 
class  DecoupledVerifyPass
 A function pass to verify the kernel for Decoupled CGRA. More...
 
class  DFGPassBuilder
 A class to access the DFG Passes. More...
 
class  DFGPassConcept
 The abstract class of the DFG pass manager interfaces. More...
 
class  DFGPassHandler
 Module Pass to create data flow graph for all kernels while aplying DFG Optimization Passes. More...
 
class  DFGPassManager
 Manages a sequence of passes over a DFG. More...
 
class  DFGPassModel
 A template wrapper used to implement the polymorphic API. More...
 
struct  DFGPassPluginLibraryInfo
 A bundled information about the DFG Pass. More...
 
class  FullStateAG
 a model of address generator without any constraints More...
 
class  InductionVariableDependency
 A derived class from LoopDependency for loop carried dependency associated with loop induction variables. More...
 
class  InstAvailability
 
class  InstMap
 collective of all the instruction mapping More...
 
class  InstMapEntry
 An abstract class for an entry to replace IR instruction to targeting CGRA instruction. More...
 
class  LoopDependency
 A base class for loop dependency relationship. More...
 
class  LoopDependencyAnalysisPass
 A loop pass to analyze memory access for decoupling. More...
 
class  LoopDependencyInfo
 LoopDependency analysis result. More...
 
class  LoopVerifyResult
 A derived class from VerifyResultBase bundling detailed results for each verification type. More...
 
class  MapCondition
 a representation of instruction mapping condition More...
 
class  MemoryLoopDependency
 A derived class from LoopDependency for loop carried dependency via memory access. More...
 
class  MemoryOpMapEntry
 A derived class from InstMapEntry for memory operation. More...
 
class  ModelError
 A custom error used to notice the specified configuration file is invalid. More...
 
class  ModelManager
 An interface for each LLVM pass to get the target CGRAModel. It can be obtained as an analysis result of ModelManagerPass. More...
 
class  ModelManagerFunctionProxy
 A proxy to access model manager from function passes. More...
 
class  ModelManagerLoopProxy
 A proxy to access model manager from loop passes. More...
 
class  ModelManagerPass
 Module Pass to give the ModuleManager. More...
 
class  ModuleAnnotationAnalysisPass
 Module Pass to analyze which annotations each function has. More...
 
class  OmpKernelAnalysisPass
 A module pass to find functions annotated as OpenMP kernels. More...
 
class  OmpKernelInfo
 A set of information regarding OpenMP target kernel. More...
 
class  OmpScheduleInfo
 Bundled values related to OpenMP statinc scheduling. More...
 
class  OmpStaticShecudleAnalysis
 A function pass to analyze OpenMP static scheduling. More...
 
class  OptKeyValue
 A pair of key and value for command line option. More...
 
class  OtherOpMapEntry
 A derived class from InstMapEntry for other type of operations. More...
 
class  RemoveScheduleRuntimePass
 
class  SimpleLoopDependency
 A derived class from LoopDependency for loop carried dependency via register. More...
 
class  SimpleVerifyResult
 Simple verification result only with a verification message. More...
 
class  TimeMultiplexedVerifyPass
 A function pass to verify the kernel for TimeMultiplexed CGRA. More...
 
class  TMCGRA
 CGRA model for category "time-multiplexed". More...
 
class  VerifyAGCompatiblePass
 A function pass to verify the memory access pattern. More...
 
class  VerifyInstAvailabilityPass
 A template class for verify the instruction availability It is possible to customize the routine with specilization. More...
 
class  VerifyModulePass
 A module pass to verify all annotated functions. More...
 
class  VerifyPassBase
 a template for verification pass More...
 
class  VerifyResult
 A derived class from VerifyResultBase bunding all kernel verification result. More...
 
class  VerifyResultBase
 An abstract class for the verification information. More...
 

Typedefs

using AGGen_t = std::function< Expected< AddressGenerator * >(json::Object *, StringRef)>
 
using DecoupleAnalysisResult = SimpleVerifyResult< VerificationKind::Decoupling >
 
using InterLoopDependencyAnalysisResult = SimpleVerifyResult< VerificationKind::InterLoopDep >
 

Enumerations

enum  VerificationKind {
  VerificationKind::FunctionSummary, VerificationKind::KernelSummary, VerificationKind::Decoupling, VerificationKind::InstAvailability,
  VerificationKind::MaxNestedLevel, VerificationKind::MemoryAccess, VerificationKind::InterLoopDep, VerificationKind::NestedPerfectly,
  VerificationKind::IterationSize, VerificationKind::Conditional, VerificationKind::FunctionCall
}
 Kind of verification. More...
 

Functions

void verifySCEVAsAffineAG (const SCEV *S, LoopStandardAnalysisResults &AR, AffineAGCompatibility::ConfigTy &C)
 
bool parseStartSCEV (const SCEV *S, int *offset, Value **base)
 
unsigned computeLoopTripCount (const Loop *L, LoopStandardAnalysisResults &AR)
 
Expected< std::pair< StringRef, MapCondition * > > createMapCondition (json::Object *json_obj, StringRef filename)
 create a MapCondition instance from json object More...
 
Expected< SmallVector< std::string > > getStringArray (json::Object *json_obj, StringRef key, StringRef filename)
 Get the String Array from json object. More...
 
Expected< CGRAModel * > parseCGRASetting (StringRef filepath, ModuleAnalysisManager &MAM)
 a helper function to instantiate CGRAModel based on JSON configfile More...
 
template<typename SettingT >
SmallVector< StringRef > get_setting_values (StringMap< SettingT > settingMap)
 a template to extract only values from SettingMap More...
 
template<typename SettingT >
bool containsValidData (StringMap< SettingT > settingMap, StringRef val)
 Check if val is a valid setting for SettingT. More...
 
Expected< CGRAModel::CGRACategorygetCategory (json::Object *json_obj, StringRef filename)
 Get CGRACategory from JSON config. More...
 
template<char const * key_str, typename SettingT >
Expected< SettingT > getOption (json::Object *json_obj, StringRef filename, StringMap< SettingT > settingMap)
 Get common option from JSON config. More...
 
Expected< AddressGenerator * > parseAGConfig (json::Object *json_obj, StringRef filename)
 parse a JSON config and instantiate AddressGenerator More...
 
Expected< AddressGenerator * > createAffineAG (json::Object *json_obj, StringRef filename)
 Create a AffineAG object according to JSON config. More...
 

Variables

cl::opt< string > PathToCGRAConfig
 path to model config More...
 
cl::alias PathToCGRAConfigAlias
 alias of config file path More...
 
cl::opt< bool > OptVerbose
 a verbose option More...
 
cl::opt< string > OptDFGOpKey
 key string for opcode in DOT graph More...
 
cl::opt< bool > OptDFGPlainNodeName
 to save human readable DOT More...
 
cl::list< OptKeyValueOptDFGGraphProp
 to set common preference for graph More...
 
cl::list< OptKeyValueOptDFGNodeProp
 to set common preference for node More...
 
cl::list< OptKeyValueOptDFGEdgeProp
 to set common preference for edge More...
 
cl::opt< int > OptDFGFloatPrecWidth
 to specify precision width for floating-point number in DOT file More...
 
cl::list< string > OptDFGPassPipeline
 to specify which DFG Pass is applied More...
 
cl::list< string > OptDFGPassPlugin
 path list to load user DFG pass libraries More...
 
cl::opt< string > OptDFGFilePrefix
 prefix for dot file name More...
 
cl::opt< bool > OptLoopInvariantAsConstant
 consider loop invariant memory load as constant values for decoupled CGRAs More...
 
cl::opt< bool > OptUseSimpleDFGName
 simplify the file name of DFG More...
 
cl::opt< int > OptMemoryDependencyDistanceThreshold
 threshold count for how close memory dependency is regarded as a data dependency in data flow graph More...
 
cl::opt< bool > OptEnableLoopFlatten
 to enable loop-flatten pass for CGRA kernel More...
 

Typedef Documentation

◆ AGGen_t

using CGRAOmp::AGGen_t = typedef std::function<Expected<AddressGenerator*>(json::Object*,StringRef)>

◆ DecoupleAnalysisResult

◆ InterLoopDependencyAnalysisResult

Enumeration Type Documentation

◆ VerificationKind

Kind of verification.

Enumerator
FunctionSummary 

Summary of the verfication for a function including kernels.

KernelSummary 

Summary of the loop verification.

Decoupling 

Checking the loop kernel is able to be decoupled.

InstAvailability 

Checking the instructions needed in the kernel are supported or not.

MaxNestedLevel 

Checking the kernel exceeds the maximumn nested level.

MemoryAccess 

Checking each memory access meets the allowed access pattern.

InterLoopDep 

Checking the loop has inter-loop-dependency.

NestedPerfectly 

Checking if the loop nested structure is perfectly nested or not.

IterationSize 
Conditional 

Checking if the loop contains condional part or not.

FunctionCall 

Checking if the loop contains function call.

Function Documentation

◆ computeLoopTripCount()

unsigned CGRAOmp::computeLoopTripCount ( const Loop *  L,
LoopStandardAnalysisResults &  AR 
)

◆ containsValidData()

template<typename SettingT >
bool CGRAOmp::containsValidData ( StringMap< SettingT >  settingMap,
StringRef  val 
)

Check if val is a valid setting for SettingT.

Template Parameters
SettingTtype of setting value (e.g., CGRACategory)
Parameters
settingMapmap setting string to SettingT value
vala value of string to be checked
Returns
true the value is valid
false the value is unknown

◆ createAffineAG()

Expected< AddressGenerator * > CGRAOmp::createAffineAG ( json::Object *  json_obj,
StringRef  filename 
)

Create a AffineAG object according to JSON config.

Parameters
json_objparsed JSON config
filenamefilename of JSON config (just for error message)
Returns
Expected<AddressGenerator*> a pointer to the generated AddressGenerator instance if there is no error. Otherwise, it contains ModelError

◆ createMapCondition()

Expected< pair< StringRef, MapCondition * > > CGRAOmp::createMapCondition ( json::Object *  json_obj,
StringRef  filename 
)

create a MapCondition instance from json object

Parameters
json_obja json object containing information for the mapping condition
filenamefilename of JSON config (just for error message)
Returns
Expected<std::pair<StringRef,MapCondition*>> a pair of opcode string of an instruction and the conrresponding mapping condition if there is no error. Otherwise, it will return ModelError.

Here is an explation regarding a valid JSON object

  • Required fileds
    • An instruction to be replaced
      • key: "inst"
      • value: string of the opcode
    • A name to be mapped
      • key: "map"
      • value: string of the name to be mapped
  • Optional fileds
    • A list of instruction flags
      • key: "flags"
      • value: an array of string
    • A predicate for comparison instructions
      • key: "pred"
      • value: string of the predicate type
    • A constant operand
      • key:
        • "lhs" for left hand side of operand
        • "rhs" for right hand side of operand
    • value: an object as following
      • For interger: {"ConstantInt": int_value }
      • For double: {"ConstantDouble": double_value }

◆ get_setting_values()

template<typename SettingT >
SmallVector< StringRef > CGRAOmp::get_setting_values ( StringMap< SettingT >  settingMap)

a template to extract only values from SettingMap

Template Parameters
SettingTtype of setting value (e.g., CGRACategory)
Parameters
settingMapmap setting string to SettingT value
Returns
SmallVector<StringRef> the extracted values

◆ getCategory()

Expected< CGRAModel::CGRACategory > CGRAOmp::getCategory ( json::Object *  json_obj,
StringRef  filename 
)

Get CGRACategory from JSON config.

Parameters
json_objparsed JSON config
filenamefilename of JSON config (just for error message)
Returns
Expected<CGRAModel::CGRACategory> CGRACategory if there is no error. Otherwise, it contains ModelError.

◆ getOption()

template<char const * key_str, typename SettingT >
Expected< SettingT > CGRAOmp::getOption ( json::Object *  json_obj,
StringRef  filename,
StringMap< SettingT >  settingMap 
)

Get common option from JSON config.

Template Parameters
*key_strkey string
SettingTtype of setting value (e.g., CGRACategory)
Parameters
json_objparsed JSON config
filenamefilename of JSON config (just for error message)
settingMapmap setting string to SettingT value
Returns
Expected<SettingT> SettingT value if there is no error. Otherwise, it contains ModelError.

checking steps

  1. an item whose key = key_str exists?
  2. its value is an object?
  3. the object contains an item whose key = "allowed"?
  4. its value is boolean type?
    • false: return SettingT::No
    • true: continue
  5. the object contains an item whose key = "type"?
  6. its value is string type?
  7. settingMap contains its value as key?

◆ getStringArray()

Expected< SmallVector< string > > CGRAOmp::getStringArray ( json::Object *  json_obj,
StringRef  key,
StringRef  filename 
)

Get the String Array from json object.

Parameters
json_obja json object containing an item of array
keya key of the array
filenameilename of JSON config (just for error message)
Returns
Expected<SmallVector<std::string>> obtained array of strings if there is no error. Otherwise, it will return ModelError.

◆ parseAGConfig()

Expected< AddressGenerator * > CGRAOmp::parseAGConfig ( json::Object *  json_obj,
StringRef  filename 
)

parse a JSON config and instantiate AddressGenerator

Parameters
json_objparsed JSON config
filenamefilename of JSON config (just for error message)
Returns
Expected<AddressGenerator*> a pointer to the generated AddressGenerator instance if there is no error. Otherwise, it contains ModelError

◆ parseCGRASetting()

Expected< CGRAModel * > CGRAOmp::parseCGRASetting ( StringRef  filepath,
ModuleAnalysisManager &  MAM 
)

a helper function to instantiate CGRAModel based on JSON configfile

Parameters
filepathfilepath to the JSON config file
MAMModuleAnalysisManager
Returns
Expected<CGRAModel> CGRAModel if there is no error. Otherwise, it contains ModelError

◆ parseStartSCEV()

bool CGRAOmp::parseStartSCEV ( const SCEV *  S,
int *  offset,
Value **  base 
)

◆ verifySCEVAsAffineAG()

void CGRAOmp::verifySCEVAsAffineAG ( const SCEV *  S,
LoopStandardAnalysisResults &  AR,
AffineAGCompatibility::ConfigTy C 
)

Variable Documentation

◆ OptDFGEdgeProp

cl::list< CGRAOmp::OptKeyValue > CGRAOmp::OptDFGEdgeProp

to set common preference for edge

◆ OptDFGFilePrefix

cl::opt< string > CGRAOmp::OptDFGFilePrefix

prefix for dot file name

◆ OptDFGFloatPrecWidth

cl::opt< int > CGRAOmp::OptDFGFloatPrecWidth

to specify precision width for floating-point number in DOT file

◆ OptDFGGraphProp

cl::list< CGRAOmp::OptKeyValue > CGRAOmp::OptDFGGraphProp

to set common preference for graph

◆ OptDFGNodeProp

cl::list< CGRAOmp::OptKeyValue > CGRAOmp::OptDFGNodeProp

to set common preference for node

◆ OptDFGOpKey

cl::opt< string > CGRAOmp::OptDFGOpKey

key string for opcode in DOT graph

◆ OptDFGPassPipeline

cl::list< string > CGRAOmp::OptDFGPassPipeline

to specify which DFG Pass is applied

◆ OptDFGPassPlugin

cl::list< string > CGRAOmp::OptDFGPassPlugin

path list to load user DFG pass libraries

◆ OptDFGPlainNodeName

cl::opt< bool > CGRAOmp::OptDFGPlainNodeName

to save human readable DOT

◆ OptEnableLoopFlatten

cl::opt< bool > CGRAOmp::OptEnableLoopFlatten

to enable loop-flatten pass for CGRA kernel

◆ OptLoopInvariantAsConstant

cl::opt< bool > CGRAOmp::OptLoopInvariantAsConstant

consider loop invariant memory load as constant values for decoupled CGRAs

◆ OptMemoryDependencyDistanceThreshold

cl::opt< int > CGRAOmp::OptMemoryDependencyDistanceThreshold

threshold count for how close memory dependency is regarded as a data dependency in data flow graph

◆ OptUseSimpleDFGName

cl::opt< bool > CGRAOmp::OptUseSimpleDFGName

simplify the file name of DFG

◆ OptVerbose

cl::opt< bool > CGRAOmp::OptVerbose

a verbose option

◆ PathToCGRAConfig

cl::opt< string > CGRAOmp::PathToCGRAConfig

path to model config

◆ PathToCGRAConfigAlias

cl::alias CGRAOmp::PathToCGRAConfigAlias

alias of config file path