Intel® Implicit SPMD Program Compiler (Intel® ISPC)  1.13.0
Functions
builtins.h File Reference

Declarations of functions related to builtins and the standard library. More...

#include "ispc.h"
Include dependency graph for builtins.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void DefineStdlib (SymbolTable *symbolTable, llvm::LLVMContext *ctx, llvm::Module *module, bool includeStdlib)
 
void AddBitcodeToModule (const BitcodeLib *lib, llvm::Module *module, SymbolTable *symbolTable=NULL, bool warn=true)
 

Detailed Description

Declarations of functions related to builtins and the standard library.

Definition in file builtins.h.

Function Documentation

◆ AddBitcodeToModule()

void AddBitcodeToModule ( const BitcodeLib lib,
llvm::Module *  module,
SymbolTable symbolTable,
bool  warn 
)

This utility function takes serialized binary LLVM bitcode and adds its definitions to the given module. Functions in the bitcode that can be mapped to ispc functions are also added to the symbol table.

Parameters
libPointer to BitcodeLib class representing LLVM bitcode (e.g. the contents of a *.bc file)
moduleModule to link the bitcode into
symbolTableSymbol table to add definitions to

Definition at line 746 of file builtins.cpp.

References Assert, Globals::ctx, Debug(), Error(), g, BitcodeLib::getLib(), BitcodeLib::getSize(), lAddModuleSymbols(), lCheckModuleIntrinsics(), lSetInternalFunctions(), m, Module::module, VerifyDataLayoutCompatibility(), and Warning().

Referenced by DefineStdlib(), and lInitDispatchModule().

◆ DefineStdlib()

void DefineStdlib ( SymbolTable symbolTable,
llvm::LLVMContext *  ctx,
llvm::Module *  module,
bool  includeStdlib 
)

Adds declarations and definitions of ispc standard library functions and types to the given module.

Parameters
symbolTableSymbolTable in which to add symbol definitions for stdlib stuff
ctxllvm::LLVMContext to use for getting types and the like for standard library definitions
moduleModule in which to add the declarations/definitions
includeStdlibIndicates whether the definitions from the stdlib.ispc file should be added to the module.

Definition at line 920 of file builtins.cpp.

References AddBitcodeToModule(), Assert, emitLLVMUsed(), Opt::fastMaskedVload, FATAL, Globals::forceAlignment, g, Globals::generateDebuggingSymbols, Target::GENERIC, Target::getArch(), TargetLibRegistry::getBuiltinsCLib(), Target::getISA(), Target::getISPCTarget(), TargetLibRegistry::getISPCTargetLib(), Target::getMaskBitCount(), Target::getVectorWidth(), Target::hasHalf(), Target::hasRand(), Target::hasRcpd(), Target::hasRsqrtd(), Target::hasTranscendentals(), Target::hasTrigonometry(), lDefineConstantInt(), lDefineConstantIntFunc(), lDefineProgramIndex(), LLVMInt32(), Globals::Math_ISPC, Globals::Math_ISPCFast, Globals::Math_SVML, Globals::Math_System, Globals::mathLib, Globals::opt, Globals::target, Globals::target_os, Globals::target_registry, yy_scan_string(), and yyparse().

Referenced by Module::CompileFile().