|
Proteus
Programmable JIT compilation and optimization for C/C++ using LLVM
|
#include <CodeBuilder.h>

Public Member Functions | |
| virtual | ~CodeBuilder ()=default |
| virtual TargetModelType | getTargetModel () const =0 |
| virtual IRFunction * | addFunction (const std::string &Name, IRType RetTy, const std::vector< IRType > &ArgTys)=0 |
| virtual void | setFunctionName (IRFunction *F, const std::string &Name)=0 |
Rename the function identified by F. | |
| virtual IRValue * | getArg (IRFunction *F, size_t Idx)=0 |
Return the Nth argument of F as an IRValue. | |
| virtual void | beginFunction (IRFunction *F, const char *File, int Line)=0 |
Set F as the active function and begin IR emission. | |
| virtual void | endFunction ()=0 |
| virtual void | setInsertPointAtEntry ()=0 |
| virtual void | clearInsertPoint ()=0 |
| virtual void | beginIf (IRValue *Cond, const char *File, int Line)=0 |
| virtual void | endIf ()=0 |
| virtual void | beginFor (IRValue *IterSlot, IRType IterTy, IRValue *InitVal, IRValue *UpperBoundVal, IRValue *IncVal, bool IsSigned, const char *File, int Line, LoopHints Hints={})=0 |
| virtual void | endFor ()=0 |
| virtual void | beginWhile (std::function< IRValue *()> CondFn, const char *File, int Line)=0 |
| virtual void | endWhile ()=0 |
| virtual void | createRetVoid ()=0 |
| virtual void | createRet (IRValue *V)=0 |
| virtual IRValue * | createArith (ArithOp Op, IRValue *LHS, IRValue *RHS, IRType Ty)=0 |
| virtual IRValue * | createAtomicAdd (IRValue *Addr, IRValue *Val)=0 |
| virtual IRValue * | createAtomicSub (IRValue *Addr, IRValue *Val)=0 |
| virtual IRValue * | createAtomicMax (IRValue *Addr, IRValue *Val)=0 |
| virtual IRValue * | createAtomicMin (IRValue *Addr, IRValue *Val)=0 |
| virtual IRValue * | createCmp (CmpOp Op, IRValue *LHS, IRValue *RHS, IRType Ty)=0 |
| virtual IRValue * | createAnd (IRValue *LHS, IRValue *RHS)=0 |
| virtual IRValue * | createOr (IRValue *LHS, IRValue *RHS)=0 |
| virtual IRValue * | createXor (IRValue *LHS, IRValue *RHS)=0 |
| virtual IRValue * | createNot (IRValue *Val)=0 |
| virtual IRValue * | createLoad (IRType Ty, IRValue *Ptr, const std::string &Name="")=0 |
| virtual void | createStore (IRValue *Val, IRValue *Ptr)=0 |
| virtual IRValue * | createCast (IRValue *V, IRType FromTy, IRType ToTy)=0 |
| virtual IRValue * | createBitCast (IRValue *V, IRType DestTy)=0 |
| virtual IRValue * | createZExt (IRValue *V, IRType DestTy)=0 |
| virtual IRValue * | getConstantInt (IRType Ty, uint64_t Val)=0 |
| virtual IRValue * | getConstantFP (IRType Ty, double Val)=0 |
| virtual VarAlloc | getElementPtr (IRValue *Base, IRType BaseTy, IRValue *Index, IRType ElemTy)=0 |
| virtual VarAlloc | getElementPtr (IRValue *Base, IRType BaseTy, size_t Index, IRType ElemTy)=0 |
| virtual IRValue * | createCall (const std::string &FName, IRType RetTy, const std::vector< IRType > &ArgTys, const std::vector< IRValue * > &Args)=0 |
| virtual IRValue * | createCall (const std::string &FName, IRType RetTy)=0 |
| virtual IRValue * | loadScalar (IRValue *Slot, IRType ValueTy)=0 |
Load the value stored directly in Slot (scalar alloca). | |
| virtual void | storeScalar (IRValue *Slot, IRValue *Val)=0 |
Store Val directly into Slot (scalar alloca). | |
| virtual IRValue * | loadAddress (IRValue *Slot, IRType AllocTy)=0 |
Load the pointer stored in Slot (pointer alloca). | |
| virtual void | storeAddress (IRValue *Slot, IRValue *Addr)=0 |
Store Addr into Slot (pointer alloca). | |
| virtual IRValue * | loadFromPointee (IRValue *Slot, IRType AllocTy, IRType ValueTy)=0 |
Dereference the pointer stored in Slot, then load the pointee. | |
| virtual void | storeToPointee (IRValue *Slot, IRType AllocTy, IRValue *Val)=0 |
Dereference the pointer stored in Slot, then store Val to it. | |
| virtual VarAlloc | allocScalar (const std::string &Name, IRType ValueTy)=0 |
| virtual VarAlloc | allocPointer (const std::string &Name, IRType ElemTy, unsigned AddrSpace=0)=0 |
| virtual VarAlloc | allocArray (const std::string &Name, AddressSpace AS, IRType ElemTy, size_t NElem)=0 |
Abstract code-builder interface. The frontend (Var.h, Func.h, LoopNest.h) depends only on this class.
|
virtualdefault |
|
pure virtual |
Create a function with the given name and signature. Returns an opaque IRFunction handle owned by this builder.
Implemented in proteus::LLVMCodeBuilder.
|
pure virtual |
Implemented in proteus::LLVMCodeBuilder.
|
pure virtual |
Implemented in proteus::LLVMCodeBuilder.
|
pure virtual |
Implemented in proteus::LLVMCodeBuilder.
|
pure virtual |
IterSlot : alloca holding the loop iterator. IterTy : value type of the iterator (must be an integer type). InitVal : initial value to store into IterSlot. UpperBoundVal : exclusive upper bound for the loop condition. IncVal : increment added to the iterator on each iteration. IsSigned : true → ICmpSLT, false → ICmpULT.
Implemented in proteus::LLVMCodeBuilder.
|
pure virtual |
Set F as the active function and begin IR emission.
Implemented in proteus::LLVMCodeBuilder.
|
pure virtual |
Implemented in proteus::LLVMCodeBuilder.
|
pure virtual |
CondFn : callable that emits the condition IR at the current insert point and returns the resulting i1 Value (true → continue loop).
Implemented in proteus::LLVMCodeBuilder.
|
pure virtual |
Implemented in proteus::LLVMCodeBuilder.
Implemented in proteus::LLVMCodeBuilder.
|
pure virtual |
Implemented in proteus::LLVMCodeBuilder.
|
pure virtual |
Implemented in proteus::LLVMCodeBuilder.
|
pure virtual |
Implemented in proteus::LLVMCodeBuilder.
|
pure virtual |
Implemented in proteus::LLVMCodeBuilder.
|
pure virtual |
Implemented in proteus::LLVMCodeBuilder.
Implemented in proteus::LLVMCodeBuilder.
|
pure virtual |
Implemented in proteus::LLVMCodeBuilder.
|
pure virtual |
Implemented in proteus::LLVMCodeBuilder.
|
pure virtual |
Implemented in proteus::LLVMCodeBuilder.
|
pure virtual |
Implemented in proteus::LLVMCodeBuilder.
|
pure virtual |
Implemented in proteus::LLVMCodeBuilder.
Implemented in proteus::LLVMCodeBuilder.
Implemented in proteus::LLVMCodeBuilder.
|
pure virtual |
Implemented in proteus::LLVMCodeBuilder.
|
pure virtual |
Implemented in proteus::LLVMCodeBuilder.
Implemented in proteus::LLVMCodeBuilder.
Implemented in proteus::LLVMCodeBuilder.
Implemented in proteus::LLVMCodeBuilder.
|
pure virtual |
Implemented in proteus::LLVMCodeBuilder.
|
pure virtual |
Implemented in proteus::LLVMCodeBuilder.
|
pure virtual |
Implemented in proteus::LLVMCodeBuilder.
|
pure virtual |
Implemented in proteus::LLVMCodeBuilder.
|
pure virtual |
Return the Nth argument of F as an IRValue.
Implemented in proteus::LLVMCodeBuilder.
Implemented in proteus::LLVMCodeBuilder.
Implemented in proteus::LLVMCodeBuilder.
|
pure virtual |
Implemented in proteus::LLVMCodeBuilder.
|
pure virtual |
Implemented in proteus::LLVMCodeBuilder.
|
pure virtual |
Implemented in proteus::LLVMCodeBuilder.
Load the pointer stored in Slot (pointer alloca).
Implemented in proteus::LLVMCodeBuilder.
|
pure virtual |
Dereference the pointer stored in Slot, then load the pointee.
Implemented in proteus::LLVMCodeBuilder.
Load the value stored directly in Slot (scalar alloca).
Implemented in proteus::LLVMCodeBuilder.
|
pure virtual |
Rename the function identified by F.
Implemented in proteus::LLVMCodeBuilder.
|
pure virtual |
Implemented in proteus::LLVMCodeBuilder.
Store Addr into Slot (pointer alloca).
Implemented in proteus::LLVMCodeBuilder.
Store Val directly into Slot (scalar alloca).
Implemented in proteus::LLVMCodeBuilder.
|
pure virtual |
Dereference the pointer stored in Slot, then store Val to it.
Implemented in proteus::LLVMCodeBuilder.