CGRAOmp  0.1
Classes | Namespaces | Macros | Functions
CGRAInstMap.hpp File Reference
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/IR/Constant.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/InstrTypes.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Operator.h"
#include "llvm/Support/JSON.h"
#include "llvm/IR/PassManager.h"
#include "common.hpp"
#include "CGRAOmpAnnotationPass.hpp"
#include <float.h>
#include <math.h>

Go to the source code of this file.

Classes

class  CGRAOmp::MapCondition
 a representation of instruction mapping condition More...
 
class  CGRAOmp::InstMapEntry
 An abstract class for an entry to replace IR instruction to targeting CGRA instruction. More...
 
class  CGRAOmp::BinaryOpMapEntry
 A derived class from InstMapEntry for BinaryOperation. More...
 
class  CGRAOmp::CompOpMapEntry
 A derived class from InstMapEntry for comparison instructions. More...
 
class  CGRAOmp::MemoryOpMapEntry
 A derived class from InstMapEntry for memory operation. More...
 
class  CGRAOmp::CustomInstMapEntry
 A derived class from InstMapEntry for custom instruction. More...
 
class  CGRAOmp::OtherOpMapEntry
 A derived class from InstMapEntry for other type of operations. More...
 
class  CGRAOmp::InstMap
 collective of all the instruction mapping More...
 

Namespaces

 CGRAOmp
 

Macros

#define CGRAOMP_CUSTOM_INST_ATTR   "cgra_custom_inst"
 
#define FLAG_GETTER(FLAG, ISA, GETTER)
 
#define CMP_PRED_PAIR(STR, ENUM)   make_pair(STR, CmpInst::Predicate::ENUM)
 
#define BINOP_ENTRY(OPCODE, OPENUM)
 
#define COMPOP_ENTRY(OPCODE, IS_INTEGER)
 
#define MEMOP_ENTRY(OPCODE, OPENUM)
 
#define OTHEROP_ENTRY(OPCODE, OPENUM)
 
#define INST_KEY   "inst"
 
#define MAP_KEY   "map"
 
#define CONST_RHS_KEY   "rhs"
 
#define CONST_LHS_KEY   "lhs"
 
#define FLAGS_KEY   "flags"
 
#define PRED_KEY   "pred"
 
#define CONST_INT_KEY   "ConstantInt"
 
#define CONST_DBL_KEY   "ConstantDouble"
 
#define VEC_MAKE_RANGE(VEC)   (make_range(VEC.begin(), VEC.end()))
 

Functions

Expected< std::pair< StringRef, MapCondition * > > CGRAOmp::createMapCondition (json::Object *json_obj, StringRef filename)
 create a MapCondition instance from json object More...
 
Expected< SmallVector< std::string > > CGRAOmp::getStringArray (json::Object *json_obj, StringRef key, StringRef filename)
 Get the String Array from json object. More...
 

Macro Definition Documentation

◆ BINOP_ENTRY

#define BINOP_ENTRY (   OPCODE,
  OPENUM 
)
Value:
make_pair(OPCODE, [](MapCondition *c){ \
if (c) { \
return make_shared<BinaryOpMapEntry>(OPCODE, BinaryOperator::OPENUM, c); \
} else { \
return make_shared<BinaryOpMapEntry>(OPCODE, BinaryOperator::OPENUM); \
}\
})

◆ CGRAOMP_CUSTOM_INST_ATTR

#define CGRAOMP_CUSTOM_INST_ATTR   "cgra_custom_inst"

◆ CMP_PRED_PAIR

#define CMP_PRED_PAIR (   STR,
  ENUM 
)    make_pair(STR, CmpInst::Predicate::ENUM)

◆ COMPOP_ENTRY

#define COMPOP_ENTRY (   OPCODE,
  IS_INTEGER 
)
Value:
make_pair(OPCODE, [](MapCondition *c){ \
if (c) { \
return make_shared<CompOpMapEntry>(OPCODE, IS_INTEGER, c); \
} else { \
return make_shared<CompOpMapEntry>(OPCODE, IS_INTEGER); \
}\
})

◆ CONST_DBL_KEY

#define CONST_DBL_KEY   "ConstantDouble"

◆ CONST_INT_KEY

#define CONST_INT_KEY   "ConstantInt"

◆ CONST_LHS_KEY

#define CONST_LHS_KEY   "lhs"

◆ CONST_RHS_KEY

#define CONST_RHS_KEY   "rhs"

◆ FLAG_GETTER

#define FLAG_GETTER (   FLAG,
  ISA,
  GETTER 
)
Value:
make_pair(FLAG, [](Instruction *I) { \
if (isa<ISA>(I)) { \
return I->GETTER(); \
} else { \
return false;\
} \
})

◆ FLAGS_KEY

#define FLAGS_KEY   "flags"

◆ INST_KEY

#define INST_KEY   "inst"

◆ MAP_KEY

#define MAP_KEY   "map"

◆ MEMOP_ENTRY

#define MEMOP_ENTRY (   OPCODE,
  OPENUM 
)
Value:
make_pair(OPCODE, [](MapCondition *c){ \
if (c) { \
return make_shared<MemoryOpMapEntry>(OPCODE, Instruction::MemoryOps::OPENUM, c); \
} else { \
return make_shared<MemoryOpMapEntry>(OPCODE, Instruction::MemoryOps::OPENUM); \
}\
})

◆ OTHEROP_ENTRY

#define OTHEROP_ENTRY (   OPCODE,
  OPENUM 
)
Value:
make_pair(OPCODE, [](MapCondition *c){ \
if (c) { \
return make_shared<OtherOpMapEntry>(OPCODE, OPENUM, c); \
} else { \
return make_shared<OtherOpMapEntry>(OPCODE, OPENUM); \
}\
})

◆ PRED_KEY

#define PRED_KEY   "pred"

◆ VEC_MAKE_RANGE

#define VEC_MAKE_RANGE (   VEC)    (make_range(VEC.begin(), VEC.end()))