roadrunner  2.6.0
Fast simulator for SBML models
Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | List of all members
rrllvm::ModelDataIRBuilder Class Reference

The model data IR builder. More...

#include <ModelDataIRBuilder.h>

Public Member Functions

 ModelDataIRBuilder (llvm::Value *modelData, LLVMModelDataSymbols const &, llvm::IRBuilder<> &)
 these only make sense attached to a modelData pointer.
 
llvm::Value * createFloatSpeciesAmtGEP (const std::string &id, const llvm::Twine &name="")
 
llvm::Value * createBoundSpeciesAmtGEP (const std::string &id, const llvm::Twine &name="")
 
llvm::Value * createGlobalParamGEP (const std::string &id)
 
llvm::Value * createGEP (ModelDataFields field)
 create a GEP for a ModelData structure field. More...
 
llvm::Value * createGEP (ModelDataFields field, unsigned index, const llvm::Twine &name="")
 create a GEP for an array which belongs to the ModelData struct, only valid for arrays, will crash on non-array fields.
 
llvm::Value * createLoad (ModelDataFields field, unsigned index, const llvm::Twine &name="")
 
llvm::Value * createStore (ModelDataFields field, unsigned index, llvm::Value *value, const llvm::Twine &name="")
 
llvm::Value * createCompGEP (const std::string &id)
 the GEP for a compartment
 
llvm::Value * createCompLoad (const std::string &id, const llvm::Twine &name="")
 load the compartment value
 
llvm::Value * createCompStore (const std::string &id, llvm::Value *value)
 store the compartment value
 
llvm::Value * createInitFloatSpeciesAmtGEP (const std::string &id, const llvm::Twine &name="")
 the GEP for a floating species initial amount
 
llvm::Value * createInitBoundarySpeciesAmtGEP (const std::string &id, const llvm::Twine &name="")
 the GEP for a boundary species initial amount
 
llvm::Value * createInitFloatSpeciesAmtLoad (const std::string &id, const llvm::Twine &name="")
 load the floating species initial amount value
 
llvm::Value * createInitBoundarySpeciesAmtLoad (const std::string &id, const llvm::Twine &name="")
 load the boundary species initial amount value
 
llvm::Value * createInitFloatSpeciesAmtStore (const std::string &id, llvm::Value *value)
 store the floating species initial value
 
llvm::Value * createInitBoundarySpeciesAmtStore (const std::string &id, llvm::Value *value)
 store the boundary species initial value
 
llvm::Value * createInitCompGEP (const std::string &id, const llvm::Twine &name="")
 the GEP for a compartment
 
llvm::Value * createInitCompLoad (const std::string &id, const llvm::Twine &name="")
 load the compartment value
 
llvm::Value * createInitCompStore (const std::string &id, llvm::Value *value)
 store the compartment value
 
llvm::Value * createInitGlobalParamGEP (const std::string &id, const llvm::Twine &name="")
 the GEP for a init global params
 
llvm::Value * createInitGlobalParamLoad (const std::string &id, const llvm::Twine &name="")
 load the init global param value
 
llvm::Value * createInitGlobalParamStore (const std::string &id, llvm::Value *value)
 store the init global param value
 
llvm::Value * createGlobalParamLoad (const std::string &id, const llvm::Twine &name="")
 load the global param value
 
llvm::Value * createGlobalParamStore (const std::string &id, llvm::Value *value)
 store the global param value
 
llvm::Value * createFloatSpeciesAmtLoad (const std::string &id, const llvm::Twine &name="")
 load the floating species amount value
 
llvm::Value * createFloatSpeciesAmtStore (const std::string &id, llvm::Value *value)
 store the floating species amount
 
llvm::Value * createFloatSpeciesAmtRateGEP (const std::string &id, const llvm::Twine &name="")
 the GEP for the amount rates
 
llvm::Value * createFloatSpeciesAmtRateLoad (const std::string &id, const llvm::Twine &name="")
 load the floating species amount value
 
llvm::Value * createFloatSpeciesAmtRateStore (const std::string &id, llvm::Value *value)
 store the floating species amount
 
llvm::Value * createBoundSpeciesAmtLoad (const std::string &id, const llvm::Twine &name="")
 load the floating species amount value
 
llvm::Value * createBoundSpeciesAmtStore (const std::string &id, llvm::Value *value)
 store the floating species amount
 
llvm::Value * createReactionRateLoad (const std::string &id, const llvm::Twine &name="")
 load the floating species amount value
 
llvm::Value * createReactionRateStore (const std::string &id, llvm::Value *value)
 store the floating species amount
 
llvm::Value * createRateRuleValueGEP (const std::string &id, const llvm::Twine &name="")
 rate rule GEP
 
llvm::Value * createRateRuleValueLoad (const std::string &id, const llvm::Twine &name="")
 load the rate rule value
 
llvm::Value * createRateRuleValueStore (const std::string &id, llvm::Value *value)
 store the rate rule value
 
llvm::Value * createRateRuleRateGEP (const std::string &id, const llvm::Twine &name="")
 rate rule GEP
 
llvm::Value * createRateRuleRateLoad (const std::string &id, const llvm::Twine &name="")
 load the rate rule rate
 
llvm::Value * createRateRuleRateStore (const std::string &id, llvm::Value *value)
 store the rate rule rate
 
llvm::Value * createStoichiometryStore (uint row, uint col, llvm::Value *value, const llvm::Twine &name="")
 
llvm::Value * createStoichiometryLoad (uint row, uint col, const llvm::Twine &name="")
 
llvm::Value * createRandomLoad ()
 pointer to ModelData::random field.
 

Static Public Member Functions

static llvm::CallInst * createCSRMatrixSetNZ (llvm::IRBuilder<> &, llvm::Value *csrPtr, llvm::Value *row, llvm::Value *col, llvm::Value *value, const llvm::Twine &name="")
 create a call to the csr_matrix_set_nz function. More...
 
static llvm::CallInst * createCSRMatrixGetNZ (llvm::IRBuilder<> &, llvm::Value *csrPtr, llvm::Value *row, llvm::Value *col, const llvm::Twine &name="")
 create a call to the csr_matrix_get_nz function. More...
 
static llvm::Function * getCSRMatrixSetNZDecl (llvm::Module *module)
 get the function declaration (prototype) for the csr_matrix_set_nz function. More...
 
static llvm::Function * getCSRMatrixGetNZDecl (llvm::Module *module)
 get the function declaration (prototype) for the csr_matrix_set_nz function. More...
 
static llvm::StructType * getCSRSparseStructType (llvm::Module *module, llvm::ExecutionEngine *engine=0)
 get the struct type for the CSR sparse storage struct. More...
 
static llvm::StructType * createModelDataStructType (llvm::Module *module, llvm::ExecutionEngine *engine, LLVMModelDataSymbols const &symbols)
 Creates a ModelData struct for the given sbml symbols in the llvm Module. More...
 
static llvm::StructType * getStructType (llvm::Module *module)
 get the ModelData struct type. More...
 
static unsigned getModelDataSize (llvm::Module *module, const llvm::DataLayout &dl)
 

Static Public Attributes

static const char * LLVMModelDataName = "rr_LLVMModelData"
 
static const char * csr_matrixName = "rr_csr_matrix"
 
static const char * csr_matrix_set_nzName = "csr_matrix_set_nz"
 
static const char * csr_matrix_get_nzName = "csr_matrix_get_nz"
 

Friends

class LLVMModelDataIRBuilderTesting
 

Detailed Description

The model data IR builder.

(Sorry, this is very old code.)

Member Function Documentation

◆ createCSRMatrixGetNZ()

llvm::CallInst * rrllvm::ModelDataIRBuilder::createCSRMatrixGetNZ ( llvm::IRBuilder<> &  ,
llvm::Value *  csrPtr,
llvm::Value *  row,
llvm::Value *  col,
const llvm::Twine &  name = "" 
)
static

create a call to the csr_matrix_get_nz function.

only valid whilst a basic block is being filled.

◆ createCSRMatrixSetNZ()

llvm::CallInst * rrllvm::ModelDataIRBuilder::createCSRMatrixSetNZ ( llvm::IRBuilder<> &  ,
llvm::Value *  csrPtr,
llvm::Value *  row,
llvm::Value *  col,
llvm::Value *  value,
const llvm::Twine &  name = "" 
)
static

create a call to the csr_matrix_set_nz function.

only valid whilst a basic block is being filled.

◆ createGEP()

llvm::Value * rrllvm::ModelDataIRBuilder::createGEP ( ModelDataFields  field)

create a GEP for a ModelData structure field.

Parameters
fieldvalue for a ModelData pointer type.

◆ createModelDataStructType()

llvm::StructType * rrllvm::ModelDataIRBuilder::createModelDataStructType ( llvm::Module *  module,
llvm::ExecutionEngine *  engine,
LLVMModelDataSymbols const &  symbols 
)
static

Creates a ModelData struct for the given sbml symbols in the llvm Module.

This must be called before any model accessing code is generated.

◆ getCSRMatrixGetNZDecl()

llvm::Function * rrllvm::ModelDataIRBuilder::getCSRMatrixGetNZDecl ( llvm::Module *  module)
static

get the function declaration (prototype) for the csr_matrix_set_nz function.

create if not found

◆ getCSRMatrixSetNZDecl()

llvm::Function * rrllvm::ModelDataIRBuilder::getCSRMatrixSetNZDecl ( llvm::Module *  module)
static

get the function declaration (prototype) for the csr_matrix_set_nz function.

create if not found.

◆ getCSRSparseStructType()

llvm::StructType * rrllvm::ModelDataIRBuilder::getCSRSparseStructType ( llvm::Module *  module,
llvm::ExecutionEngine *  engine = 0 
)
static

get the struct type for the CSR sparse storage struct.

create if not found

◆ getStructType()

llvm::StructType * rrllvm::ModelDataIRBuilder::getStructType ( llvm::Module *  module)
static

get the ModelData struct type.

createModelDataStructType must have been called for this to work.

Throws an exception if the ModelData struct could not be obtained.


The documentation for this class was generated from the following files: