Intel® Implicit SPMD Program Compiler (Intel® ISPC)
1.13.0
|
#include <func.h>
Public Member Functions | |
Function (Symbol *sym, Stmt *code) | |
const Type * | GetReturnType () const |
const FunctionType * | GetType () const |
void | GenerateIR () |
Private Member Functions | |
void | emitCode (FunctionEmitContext *ctx, llvm::Function *function, SourcePos firstStmtPos) |
Private Attributes | |
Symbol * | sym |
std::vector< Symbol * > | args |
Stmt * | code |
Symbol * | maskSymbol |
Symbol * | threadIndexSym |
Symbol * | threadCountSym |
Symbol * | taskIndexSym |
Symbol * | taskCountSym |
Symbol * | taskIndexSym0 |
Symbol * | taskCountSym0 |
Symbol * | taskIndexSym1 |
Symbol * | taskCountSym1 |
Symbol * | taskIndexSym2 |
Symbol * | taskCountSym2 |
Definition at line 69 of file func.cpp.
References args, Assert, code, Globals::debugPrint, g, FunctionType::GetNumParameters(), FunctionType::GetParameterName(), FunctionType::GetParameterType(), FunctionType::isTask, SymbolTable::LookupVariable(), m, maskSymbol, Symbol::name, Optimize(), Symbol::parentFunction, Stmt::Print(), sym, Module::symbolTable, taskCountSym, taskCountSym0, taskCountSym1, taskCountSym2, taskIndexSym, taskIndexSym0, taskIndexSym1, taskIndexSym2, threadCountSym, threadIndexSym, Symbol::type, and TypeCheck().
|
private |
Given the statements implementing a function, emit the code that implements the function. Most of the work do be done here just involves wiring up the function parameter values to be available in the function body code.
Definition at line 200 of file func.cpp.
References FunctionEmitContext::AddElementOffset(), FunctionEmitContext::AddInstrumentationPoint(), FunctionEmitContext::All(), FunctionEmitContext::AllocaInst(), args, Assert, FunctionEmitContext::BranchInst(), CHECK_MASK_AT_FUNCTION_START_COST, code, FunctionEmitContext::CreateBasicBlock(), Debug(), Opt::disableCoherentControlFlow, Opt::disableMaskAllOnOptimizations, Stmt::EmitCode(), FunctionEmitContext::EmitFunctionParameterDebugInfo(), FunctionEmitContext::EmitVariableDebugInfo(), EstimateCost(), g, Target::getArch(), FunctionEmitContext::GetCurrentBasicBlock(), FunctionEmitContext::GetFullMaskPointer(), FunctionEmitContext::GetFunctionMask(), Target::getMaskingIsFree(), FunctionType::GetReturnType(), FunctionType::GetString(), FunctionEmitContext::InitializeLabelMap(), LLVMTypes::Int32Type, FunctionType::isExported, FunctionType::isTask, FunctionType::isUnmasked, Type::IsVoidType(), lCopyInTaskParameter(), LLVMMaskAllOn, FunctionEmitContext::LoadInst(), Target::markFuncWithTargetAttr(), maskSymbol, LLVMTypes::MaskType, Symbol::name, Globals::NoOmitFramePointer, Globals::opt, Symbol::pos, ASTNode::pos, FunctionEmitContext::ReturnInst(), FunctionEmitContext::SetCurrentBasicBlock(), FunctionEmitContext::SetDebugPos(), FunctionEmitContext::SetFunctionMask(), Symbol::storagePtr, FunctionEmitContext::StoreInst(), sym, Globals::target, taskCountSym, taskCountSym0, taskCountSym1, taskCountSym2, taskIndexSym, taskIndexSym0, taskIndexSym1, taskIndexSym2, threadCountSym, threadIndexSym, Symbol::type, Warning(), and wasm32.
Referenced by GenerateIR().
void Function::GenerateIR | ( | ) |
Generate LLVM IR for the function into the current module.
Definition at line 412 of file func.cpp.
References Assert, code, Globals::ctx, emitCode(), Error(), Module::errorCount, Symbol::exportedFunction, Symbol::function, g, Target::GetISAString(), FunctionType::isExported, FunctionType::isExternC, FunctionType::isTask, FunctionType::LLVMFunctionType(), m, Globals::mangleFunctionsWithTarget, Target::markFuncWithTargetAttr(), Module::module, Symbol::name, Symbol::pos, ASTNode::pos, StmtList::stmts, sym, Globals::target, and Symbol::type.
const Type * Function::GetReturnType | ( | ) | const |
Definition at line 148 of file func.cpp.
References Assert, FunctionType::GetReturnType(), sym, and Symbol::type.
Referenced by ReturnStmt::EmitCode().
const FunctionType * Function::GetType | ( | ) | const |
Definition at line 154 of file func.cpp.
References Assert, sym, and Symbol::type.
|
private |
Definition at line 57 of file func.h.
Referenced by emitCode(), and Function().
|
private |
Definition at line 58 of file func.h.
Referenced by emitCode(), Function(), and GenerateIR().
|
private |
Definition at line 59 of file func.h.
Referenced by emitCode(), and Function().
|
private |
Definition at line 56 of file func.h.
Referenced by emitCode(), Function(), GenerateIR(), GetReturnType(), GetType(), and lCopyInTaskParameter().
|
private |
Definition at line 61 of file func.h.
Referenced by emitCode(), and Function().
|
private |
Definition at line 62 of file func.h.
Referenced by emitCode(), and Function().
|
private |
Definition at line 63 of file func.h.
Referenced by emitCode(), and Function().
|
private |
Definition at line 64 of file func.h.
Referenced by emitCode(), and Function().
|
private |
Definition at line 61 of file func.h.
Referenced by emitCode(), and Function().
|
private |
Definition at line 62 of file func.h.
Referenced by emitCode(), and Function().
|
private |
Definition at line 63 of file func.h.
Referenced by emitCode(), and Function().
|
private |
Definition at line 64 of file func.h.
Referenced by emitCode(), and Function().
|
private |
Definition at line 60 of file func.h.
Referenced by emitCode(), and Function().
|
private |
Definition at line 60 of file func.h.
Referenced by emitCode(), and Function().