Intel® Implicit SPMD Program Compiler (Intel® ISPC)
1.13.0
|
Statement implementation for 'for' loops (as well as for 'while' loops). More...
#include <stmt.h>
Public Member Functions | |
ForStmt (Stmt *initializer, Expr *testExpr, Stmt *stepStatements, Stmt *bodyStatements, bool doCoherentCheck, 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 (ForStmt 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 | |
Stmt * | init |
Expr * | test |
Stmt * | step |
Stmt * | stmts |
const bool | doCoherentCheck |
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 } |
Statement implementation for 'for' loops (as well as for 'while' loops).
|
inlinestatic |
|
inlinestatic |
Definition at line 185 of file stmt.h.
References Stmt::EmitCode(), ASTNode::EstimateCost(), ASTNode::ForStmtID, 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 922 of file stmt.cpp.
References FunctionEmitContext::AddInstrumentationPoint(), AssertPos, LLVMTypes::BoolType, FunctionEmitContext::BranchIfMaskAll(), FunctionEmitContext::BranchIfMaskAny(), FunctionEmitContext::BranchInst(), FunctionEmitContext::ClearBreakLanes(), FunctionEmitContext::CreateBasicBlock(), Opt::disableMaskAllOnOptimizations, Opt::disableUniformControlFlow, doCoherentCheck, Stmt::EmitCode(), FunctionEmitContext::EndLoop(), FunctionEmitContext::EndScope(), g, FunctionEmitContext::GetCurrentBasicBlock(), FunctionEmitContext::GetFullMask(), FunctionEmitContext::GetFunctionMask(), FunctionEmitContext::GetInternalMask(), Expr::GetType(), Expr::GetValue(), init, Type::IsUniformType(), lHasVaryingBreakOrContinue(), LLVMBoolVector(), LLVMMaskAllOn, LLVMTrue, Globals::opt, ASTNode::pos, FunctionEmitContext::RestoreContinuedLanes(), FunctionEmitContext::SetBlockEntryMask(), FunctionEmitContext::SetCurrentBasicBlock(), FunctionEmitContext::SetDebugPos(), FunctionEmitContext::SetFunctionMask(), FunctionEmitContext::SetInternalMask(), FunctionEmitContext::SetInternalMaskAnd(), FunctionEmitContext::StartLoop(), FunctionEmitContext::StartScope(), step, stmts, test, and Warning().
|
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 1067 of file stmt.cpp.
References COST_UNIFORM_LOOP, COST_VARYING_LOOP, Opt::disableUniformControlFlow, g, Expr::GetType(), Type::IsUniformType(), lHasVaryingBreakOrContinue(), Globals::opt, stmts, and test.
|
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 1074 of file stmt.cpp.
References init, ASTNode::pos, Stmt::Print(), Expr::Print(), SourcePos::Print(), step, stmts, and test.
|
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 1051 of file stmt.cpp.
References Opt::disableUniformControlFlow, g, Expr::GetType(), Type::IsUniformType(), lHasVaryingBreakOrContinue(), Globals::opt, stmts, test, TypeConvertExpr(), AtomicType::UniformBool, and AtomicType::VaryingBool.
const bool ForStmt::doCoherentCheck |
Definition at line 203 of file stmt.h.
Referenced by EmitCode().
Stmt* ForStmt::init |
'for' statment initializer; may be NULL, indicating no intitializer
Definition at line 194 of file stmt.h.
Referenced by EmitCode(), Print(), and WalkAST().
Stmt* ForStmt::step |
Statements to run at the end of the loop for the loop step, before the test expression is evaluated.
Definition at line 200 of file stmt.h.
Referenced by EmitCode(), Print(), and WalkAST().
Stmt* ForStmt::stmts |
Loop body statements
Definition at line 202 of file stmt.h.
Referenced by EmitCode(), EstimateCost(), Print(), TypeCheck(), and WalkAST().
Expr* ForStmt::test |
expression that returns a value indicating whether the loop should continue for the next iteration
Definition at line 197 of file stmt.h.
Referenced by EmitCode(), EstimateCost(), Print(), TypeCheck(), and WalkAST().