Intel® Implicit SPMD Program Compiler (Intel® ISPC)
1.13.0
|
Statement implementation for parallel 'foreach' loops. More...
#include <stmt.h>
Public Member Functions | |
ForeachStmt (const std::vector< Symbol *> &loopVars, const std::vector< Expr *> &startExprs, const std::vector< Expr *> &endExprs, Stmt *bodyStatements, bool tiled, SourcePos pos) | |
void | EmitCode (FunctionEmitContext *ctx) const |
void | Print (int indent) const |
Stmt * | TypeCheck () |
int | EstimateCost () const |
Public Member Functions inherited from Stmt | |
Stmt (SourcePos p, unsigned scid) | |
virtual Stmt * | Optimize () |
Public Member Functions inherited from ASTNode | |
ASTNode (SourcePos p, unsigned scid) | |
virtual | ~ASTNode () |
unsigned | getValueID () const |
Static Public Member Functions | |
static bool | classof (ForeachStmt const *) |
static bool | classof (ASTNode const *N) |
Static Public Member Functions inherited from Stmt | |
static bool | classof (Stmt const *) |
static bool | classof (ASTNode const *N) |
Static Public Member Functions inherited from ASTNode | |
static bool | classof (ASTNode const *) |
Public Attributes | |
std::vector< Symbol * > | dimVariables |
std::vector< Expr * > | startExprs |
std::vector< Expr * > | endExprs |
bool | isTiled |
Stmt * | stmts |
Public Attributes inherited from ASTNode | |
SourcePos | pos |
Additional Inherited Members | |
Public Types inherited from ASTNode | |
enum | ASTNodeTy { AddressOfExprID, AssignExprID, BinaryExprID, ConstExprID, DerefExprID, PtrDerefExprID, RefDerefExprID, ExprListID, FunctionCallExprID, FunctionSymbolExprID, IndexExprID, StructMemberExprID, VectorMemberExprID, NewExprID, NullPointerExprID, ReferenceExprID, SelectExprID, SizeOfExprID, SymbolExprID, SyncExprID, TypeCastExprID, UnaryExprID, MaxExprID, AssertStmtID, BreakStmtID, CaseStmtID, ContinueStmtID, DeclStmtID, DefaultStmtID, DeleteStmtID, DoStmtID, ExprStmtID, ForeachActiveStmtID, ForeachStmtID, ForeachUniqueStmtID, ForStmtID, GotoStmtID, IfStmtID, LabeledStmtID, PrintStmtID, ReturnStmtID, StmtListID, SwitchStmtID, UnmaskedStmtID } |
|
inlinestatic |
|
inlinestatic |
Definition at line 246 of file stmt.h.
References Stmt::EmitCode(), ASTNode::EstimateCost(), ASTNode::ForeachStmtID, ASTNode::getValueID(), Stmt::Print(), and Stmt::TypeCheck().
|
virtual |
Emit LLVM IR for the statement, using the FunctionEmitContext to create the necessary instructions.
Implements Stmt.
Definition at line 1238 of file stmt.cpp.
References FunctionEmitContext::AddInstrumentationPoint(), FunctionEmitContext::AllocaInst(), AssertPos, FunctionEmitContext::BinaryOperator(), LLVMTypes::BoolType, FunctionEmitContext::BranchInst(), FunctionEmitContext::BroadcastValue(), FunctionEmitContext::CmpInst(), FunctionEmitContext::CreateBasicBlock(), dimVariables, FunctionEmitContext::DisableGatherScatterWarnings(), Stmt::EmitCode(), FunctionEmitContext::EmitVariableDebugInfo(), FunctionEmitContext::EnableGatherScatterWarnings(), endExprs, FunctionEmitContext::EndForeach(), FunctionEmitContext::EndScope(), FunctionEmitContext::FOREACH_REGULAR, g, FunctionEmitContext::GetCurrentBasicBlock(), FunctionEmitContext::GetFullMask(), FunctionEmitContext::GetFunction(), FunctionEmitContext::GetFunctionMask(), FunctionEmitContext::GetInternalMask(), Target::getVectorWidth(), FunctionEmitContext::I1VecToBoolVec(), LLVMTypes::Int32Type, LLVMTypes::Int32VectorType, isTiled, lGetSpans(), LLVMFalse, LLVMInt32(), LLVMMaskAllOff, LLVMMaskAllOn, LLVMTrue, FunctionEmitContext::LoadInst(), lUpdateVaryingCounter(), LLVMTypes::MaskType, ASTNode::pos, FunctionEmitContext::RestoreContinuedLanes(), FunctionEmitContext::SetBlockEntryMask(), FunctionEmitContext::SetContinueTarget(), FunctionEmitContext::SetCurrentBasicBlock(), FunctionEmitContext::SetDebugPos(), FunctionEmitContext::SetFunctionMask(), FunctionEmitContext::SetInternalMask(), startExprs, FunctionEmitContext::StartForeach(), FunctionEmitContext::StartScope(), stmts, FunctionEmitContext::StoreInst(), and Globals::target.
|
virtual |
Estimate the execution cost of the node (not including the cost of the children. The value returned should be based on the COST_* enumerant values defined in ispc.h.
Implements ASTNode.
Definition at line 1706 of file stmt.cpp.
References COST_SIMPLE_ARITH_LOGIC_OP, COST_UNIFORM_LOOP, and dimVariables.
|
virtual |
Print a representation of the statement (and any children AST nodes) to standard output. This method is used for debuggins.
Implements Stmt.
Definition at line 1708 of file stmt.cpp.
References dimVariables, endExprs, ASTNode::pos, Stmt::Print(), SourcePos::Print(), startExprs, and stmts.
|
virtual |
Type checking should be performed by the node when this method is called. In the event of an error, a NULL value may be returned. As with ASTNode::Optimize(), the caller should store the returned pointer in place of the original ASTNode *.
Implements Stmt.
Definition at line 1662 of file stmt.cpp.
References dimVariables, endExprs, Error(), ASTNode::pos, startExprs, TypeConvertExpr(), and AtomicType::UniformInt32.
std::vector<Symbol *> ForeachStmt::dimVariables |
Definition at line 254 of file stmt.h.
Referenced by EmitCode(), EstimateCost(), Print(), and TypeCheck().
std::vector<Expr *> ForeachStmt::endExprs |
Definition at line 256 of file stmt.h.
Referenced by EmitCode(), Print(), TypeCheck(), and WalkAST().
bool ForeachStmt::isTiled |
Definition at line 257 of file stmt.h.
Referenced by EmitCode().
std::vector<Expr *> ForeachStmt::startExprs |
Definition at line 255 of file stmt.h.
Referenced by EmitCode(), Print(), TypeCheck(), and WalkAST().
Stmt* ForeachStmt::stmts |
Definition at line 258 of file stmt.h.
Referenced by EmitCode(), Print(), and WalkAST().