Intel® Implicit SPMD Program Compiler (Intel® ISPC)
1.13.0
|
Implementation of the FunctionEmitContext class. More...
#include "ctx.h"
#include "expr.h"
#include "func.h"
#include "llvmutil.h"
#include "module.h"
#include "stmt.h"
#include "sym.h"
#include "type.h"
#include "util.h"
#include <llvm/BinaryFormat/Dwarf.h>
#include <map>
#include <llvm/IR/DerivedTypes.h>
#include <llvm/IR/Instructions.h>
#include <llvm/IR/Metadata.h>
#include <llvm/IR/Module.h>
Go to the source code of this file.
Classes | |
struct | CFInfo |
Functions | |
static bool | lEnclosingLoopIsForeachActive (const std::vector< CFInfo *> &controlFlowInfo) |
static llvm::Value * | lGetStringAsValue (llvm::BasicBlock *bblock, const char *s) |
static int | lArrayVectorWidth (llvm::Type *t) |
static llvm::Type * | lGetMatchingBoolVectorType (llvm::Type *type) |
static llvm::Value * | lComputeSliceIndex (FunctionEmitContext *ctx, int soaWidth, llvm::Value *indexValue, llvm::Value *ptrSliceOffset, llvm::Value **newSliceOffset) |
static llvm::Value * | lFinalSliceOffset (FunctionEmitContext *ctx, llvm::Value *ptr, const PointerType **ptrType) |
static unsigned int | lCalleeArgCount (llvm::Value *callee, const FunctionType *funcType) |
Implementation of the FunctionEmitContext class.
Definition in file ctx.cpp.
|
static |
If the given type is an array of vector types, then it's the representation of an ispc VectorType with varying elements. If it is one of these, return the array size (i.e. the VectorType's size). Otherwise return zero.
Definition at line 1370 of file ctx.cpp.
References Assert, g, Target::getVectorWidth(), and Globals::target.
Referenced by FunctionEmitContext::BinaryOperator(), FunctionEmitContext::CmpInst(), and FunctionEmitContext::NotOperator().
|
static |
Given a value representing a function to be called or possibly-varying pointer to a function to be called, figure out how many arguments the function has.
Definition at line 2958 of file ctx.cpp.
References Assert, and FunctionType::GetNumParameters().
Referenced by FunctionEmitContext::CallInst().
|
static |
Given an integer index in indexValue that's indexing into an array of soa<> structures with given soaWidth, compute the two sub-indices we need to do the actual indexing calculation:
subIndices[0] = (indexValue >> log(soaWidth)) subIndices[1] = (indexValue & (soaWidth-1))
Definition at line 1779 of file ctx.cpp.
References Assert, FunctionEmitContext::BinaryOperator(), LLVMTypes::Int32Type, LLVMTypes::Int32VectorType, LLVMTypes::Int64Type, LLVMTypes::Int64VectorType, LLVMIntAsType(), FunctionEmitContext::MatchIntegerTypes(), and FunctionEmitContext::TruncInst().
Referenced by FunctionEmitContext::GetElementPtrInst().
|
static |
Definition at line 652 of file ctx.cpp.
References CFInfo::ForeachActive, and CFInfo::type.
Referenced by FunctionEmitContext::Continue().
|
static |
Given a slice pointer to soa'd data that is a basic type (atomic, pointer, or enum type), use the slice offset to compute pointer(s) to the appropriate individual data element(s).
Definition at line 2114 of file ctx.cpp.
References Assert, FunctionEmitContext::BitCastInst(), Globals::ctx, FunctionEmitContext::ExtractInst(), g, Type::GetAsUniformType(), Type::GetBaseType(), FunctionEmitContext::GetElementPtrInst(), PointerType::GetUniform(), PointerType::GetVarying(), Type::IsBasicType(), Type::IsUniformType(), and LLVMGetName().
Referenced by FunctionEmitContext::gather(), FunctionEmitContext::loadUniformFromSOA(), FunctionEmitContext::scatter(), and FunctionEmitContext::storeUniformToSOA().
|
static |
Definition at line 1442 of file ctx.cpp.
References Assert, LLVMTypes::BoolType, g, Target::getVectorWidth(), Globals::target, and CFInfo::type.
Referenced by FunctionEmitContext::CmpInst().
|
static |
Definition at line 1258 of file ctx.cpp.
References Globals::ctx, g, LLVMInt32(), m, Module::module, and PTYPE.
Referenced by FunctionEmitContext::AddInstrumentationPoint().