OmniSciDB  1dac507f6e
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CodeGenerator.h File Reference
#include <llvm/IR/Value.h>
#include "../Analyzer/Analyzer.h"
#include "Execute.h"
+ Include dependency graph for CodeGenerator.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  CodeGenerator
 
struct  CodeGenerator::GPUCode
 
struct  CodeGenerator::GPUTarget
 
struct  CodeGenerator::ExecutorRequired
 
struct  CodeGenerator::ArgNullcheckBBs
 
class  ScalarCodeGenerator
 
struct  ScalarCodeGenerator::CompiledExpression
 

Functions

std::unique_ptr< llvm::Module > runtime_module_shallow_copy (CgenState *cgen_state)
 
std::vector< llvm::Value * > generate_column_heads_load (const int num_columns, llvm::Value *byte_stream_arg, llvm::IRBuilder<> &ir_builder, llvm::LLVMContext &ctx)
 

Function Documentation

std::vector<llvm::Value*> generate_column_heads_load ( const int  num_columns,
llvm::Value *  byte_stream_arg,
llvm::IRBuilder<> &  ir_builder,
llvm::LLVMContext &  ctx 
)

Loads individual columns from a single, packed pointers buffer (the byte stream arg)

Definition at line 1911 of file NativeCodegen.cpp.

Referenced by TableFunctionCompilationContext::generateEntryPoint().

1914  {
1915  CHECK(byte_stream_arg);
1916  const auto max_col_local_id = num_columns - 1;
1917 
1918  std::vector<llvm::Value*> col_heads;
1919  for (int col_id = 0; col_id <= max_col_local_id; ++col_id) {
1920  col_heads.emplace_back(ir_builder.CreateLoad(ir_builder.CreateGEP(
1921  byte_stream_arg, llvm::ConstantInt::get(llvm::Type::getInt32Ty(ctx), col_id))));
1922  }
1923  return col_heads;
1924 }
CHECK(cgen_state)

+ Here is the caller graph for this function:

std::unique_ptr<llvm::Module> runtime_module_shallow_copy ( CgenState cgen_state)

Makes a shallow copy (just declarations) of the runtime module. Function definitions are cloned only if they're used from the generated code.

Definition at line 1893 of file NativeCodegen.cpp.

Referenced by ResultSetReductionJIT::codegen(), and StubGenerator::generateStub().

1893  {
1894  return llvm::CloneModule(
1895 #if LLVM_VERSION_MAJOR >= 7
1896  *g_rt_module.get(),
1897 #else
1898  g_rt_module.get(),
1899 #endif
1900  cgen_state->vmap_,
1901  [](const llvm::GlobalValue* gv) {
1902  auto func = llvm::dyn_cast<llvm::Function>(gv);
1903  if (!func) {
1904  return true;
1905  }
1906  return (func->getLinkage() == llvm::GlobalValue::LinkageTypes::PrivateLinkage ||
1907  func->getLinkage() == llvm::GlobalValue::LinkageTypes::InternalLinkage);
1908  });
1909 }
std::unique_ptr< llvm::Module > g_rt_module
llvm::ValueToValueMapTy vmap_
Definition: CgenState.h:268

+ Here is the caller graph for this function: