OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CodeGenerator.h File Reference
#include <llvm/IR/Value.h>
#include "../Analyzer/Analyzer.h"
#include "Execute.h"
#include "Shared/DbObjectKeys.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::GPUTarget
 
struct  CodeGenerator::ExecutorRequired
 
struct  CodeGenerator::NullCheckCodegen
 
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 3453 of file NativeCodegen.cpp.

Referenced by TableFunctionCompilationContext::generateEntryPoint().

3456  {
3457  CHECK(byte_stream_arg);
3458  const auto max_col_local_id = num_columns - 1;
3459 
3460  std::vector<llvm::Value*> col_heads;
3461  for (int col_id = 0; col_id <= max_col_local_id; ++col_id) {
3462  auto* gep = ir_builder.CreateGEP(
3463  byte_stream_arg->getType()->getScalarType()->getPointerElementType(),
3464  byte_stream_arg,
3465  llvm::ConstantInt::get(llvm::Type::getInt32Ty(ctx), col_id));
3466  auto* load_gep = ir_builder.CreateLoad(gep->getType()->getPointerElementType(), gep);
3467  load_gep->setName(byte_stream_arg->getName() + "_" + std::to_string(col_id) + "_ptr");
3468  col_heads.emplace_back(load_gep);
3469  }
3470  return col_heads;
3471 }
std::string to_string(char const *&&v)
#define CHECK(condition)
Definition: Logger.h:291

+ 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.