OmniSciDB  467d548b97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CgenState Struct Reference

#include <CgenState.h>

+ Collaboration diagram for CgenState:

Classes

struct  FunctionOperValue
 
struct  HoistedLiteralLoadLocator
 

Public Types

using LiteralValue = boost::variant< int8_t, int16_t, int32_t, int64_t, float, double, std::pair< std::string, int >, std::string, std::vector< double >, std::vector< int32_t >, std::vector< int8_t >, std::pair< std::vector< int8_t >, int >>
 
using LiteralValues = std::vector< LiteralValue >
 

Public Member Functions

 CgenState (const size_t num_query_infos, const bool contains_left_deep_outer_join)
 
 CgenState (llvm::LLVMContext &context)
 
size_t getOrAddLiteral (const Analyzer::Constant *constant, const EncodingType enc_type, const int dict_id, const int device_id)
 
const std::unordered_map< int,
LiteralValues > & 
getLiterals () const
 
llvm::Value * addStringConstant (const std::string &str)
 
const InValuesBitmapaddInValuesBitmap (std::unique_ptr< InValuesBitmap > &in_values_bitmap)
 
llvm::Value * emitExternalCall (const std::string &fname, llvm::Type *ret_type, const std::vector< llvm::Value * > args, const std::vector< llvm::Attribute::AttrKind > &fnattrs={}, const bool has_struct_return=false)
 
llvm::Value * emitCall (const std::string &fname, const std::vector< llvm::Value * > &args)
 
size_t getLiteralBufferUsage (const int device_id)
 
llvm::Value * castToTypeIn (llvm::Value *val, const size_t bit_width)
 
std::pair< llvm::ConstantInt
*, llvm::ConstantInt * > 
inlineIntMaxMin (const size_t byte_width, const bool is_signed)
 
llvm::ConstantInt * inlineIntNull (const SQLTypeInfo &)
 
llvm::ConstantFP * inlineFpNull (const SQLTypeInfo &)
 
template<class T >
llvm::ConstantInt * llInt (const T v) const
 
llvm::ConstantFP * llFp (const float v) const
 
llvm::ConstantFP * llFp (const double v) const
 
llvm::ConstantInt * llBool (const bool v) const
 
void emitErrorCheck (llvm::Value *condition, llvm::Value *errorCode, std::string label)
 

Static Public Member Functions

static size_t literalBytes (const CgenState::LiteralValue &lit)
 
static size_t addAligned (const size_t off_in, const size_t alignment)
 

Public Attributes

llvm::Module * module_
 
llvm::Function * row_func_
 
llvm::Function * filter_func_
 
llvm::Function * current_func_
 
llvm::BasicBlock * row_func_bb_
 
llvm::BasicBlock * filter_func_bb_
 
llvm::CallInst * row_func_call_
 
llvm::CallInst * filter_func_call_
 
std::vector< llvm::Function * > helper_functions_
 
llvm::LLVMContext & context_
 
llvm::ValueToValueMapTy vmap_
 
llvm::IRBuilder ir_builder_
 
std::unordered_map< int,
std::vector< llvm::Value * > > 
fetch_cache_
 
std::vector< FunctionOperValueext_call_cache_
 
std::vector< llvm::Value * > group_by_expr_cache_
 
std::vector< llvm::Value * > str_constants_
 
std::vector< llvm::Value * > frag_offsets_
 
const bool contains_left_deep_outer_join_
 
std::vector< llvm::Value * > outer_join_match_found_per_level_
 
std::unordered_map< int,
llvm::Value * > 
scan_idx_to_hash_pos_
 
InsertionOrderedMap filter_func_args_
 
std::vector< std::unique_ptr
< const InValuesBitmap > > 
in_values_bitmaps_
 
bool needs_error_check_
 
bool needs_geos_
 
llvm::Function * query_func_
 
llvm::IRBuilder query_func_entry_ir_builder_
 
std::unordered_map< int,
std::vector< llvm::Value * > > 
query_func_literal_loads_
 
std::unordered_map
< llvm::Value
*, HoistedLiteralLoadLocator
row_func_hoisted_literals_
 

Private Member Functions

template<class T >
size_t getOrAddLiteral (const T &val, const int device_id)
 

Private Attributes

std::unordered_map< int,
LiteralValues
literals_
 
std::unordered_map< int, size_t > literal_bytes_
 

Detailed Description

Definition at line 31 of file CgenState.h.

Member Typedef Documentation

using CgenState::LiteralValue = boost::variant<int8_t, int16_t, int32_t, int64_t, float, double, std::pair<std::string, int>, std::string, std::vector<double>, std::vector<int32_t>, std::vector<int8_t>, std::pair<std::vector<int8_t>, int>>

Definition at line 198 of file CgenState.h.

using CgenState::LiteralValues = std::vector<LiteralValue>

Definition at line 199 of file CgenState.h.

Constructor & Destructor Documentation

CgenState::CgenState ( const size_t  num_query_infos,
const bool  contains_left_deep_outer_join 
)
inline

Definition at line 33 of file CgenState.h.

34  : module_(nullptr)
35  , row_func_(nullptr)
36  , filter_func_(nullptr)
37  , current_func_(nullptr)
38  , row_func_bb_(nullptr)
39  , filter_func_bb_(nullptr)
40  , row_func_call_(nullptr)
41  , filter_func_call_(nullptr)
44  , contains_left_deep_outer_join_(contains_left_deep_outer_join)
45  , outer_join_match_found_per_level_(std::max(num_query_infos, size_t(1)) - 1)
46  , needs_error_check_(false)
47  , needs_geos_(false)
48  , query_func_(nullptr)
std::vector< llvm::Value * > outer_join_match_found_per_level_
Definition: CgenState.h:352
llvm::Function * query_func_
Definition: CgenState.h:359
llvm::IRBuilder ir_builder_
Definition: CgenState.h:341
bool needs_geos_
Definition: CgenState.h:357
const bool contains_left_deep_outer_join_
Definition: CgenState.h:351
llvm::Function * row_func_
Definition: CgenState.h:331
llvm::Module * module_
Definition: CgenState.h:330
llvm::LLVMContext & context_
Definition: CgenState.h:339
llvm::Function * current_func_
Definition: CgenState.h:333
llvm::CallInst * filter_func_call_
Definition: CgenState.h:337
bool needs_error_check_
Definition: CgenState.h:356
llvm::IRBuilder query_func_entry_ir_builder_
Definition: CgenState.h:360
llvm::BasicBlock * filter_func_bb_
Definition: CgenState.h:335
llvm::Function * filter_func_
Definition: CgenState.h:332
llvm::LLVMContext & getGlobalLLVMContext()
llvm::CallInst * row_func_call_
Definition: CgenState.h:336
llvm::BasicBlock * row_func_bb_
Definition: CgenState.h:334
CgenState::CgenState ( llvm::LLVMContext &  context)
inline

Definition at line 51 of file CgenState.h.

52  : module_(nullptr)
53  , row_func_(nullptr)
54  , context_(context)
57  , needs_error_check_(false)
58  , needs_geos_(false)
59  , query_func_(nullptr)
llvm::Function * query_func_
Definition: CgenState.h:359
llvm::IRBuilder ir_builder_
Definition: CgenState.h:341
bool needs_geos_
Definition: CgenState.h:357
const bool contains_left_deep_outer_join_
Definition: CgenState.h:351
llvm::Function * row_func_
Definition: CgenState.h:331
llvm::Module * module_
Definition: CgenState.h:330
llvm::LLVMContext & context_
Definition: CgenState.h:339
bool needs_error_check_
Definition: CgenState.h:356
llvm::IRBuilder query_func_entry_ir_builder_
Definition: CgenState.h:360

Member Function Documentation

static size_t CgenState::addAligned ( const size_t  off_in,
const size_t  alignment 
)
inlinestatic

Definition at line 400 of file CgenState.h.

Referenced by getOrAddLiteral(), and Executor::serializeLiterals().

400  {
401  size_t off = off_in;
402  if (off % alignment != 0) {
403  off += (alignment - off % alignment);
404  }
405  return off + alignment;
406  }

+ Here is the caller graph for this function:

const InValuesBitmap* CgenState::addInValuesBitmap ( std::unique_ptr< InValuesBitmap > &  in_values_bitmap)
inline

Definition at line 212 of file CgenState.h.

References in_values_bitmaps_.

Referenced by CodeGenerator::codegen().

213  {
214  if (in_values_bitmap->isEmpty()) {
215  return in_values_bitmap.get();
216  }
217  in_values_bitmaps_.emplace_back(std::move(in_values_bitmap));
218  return in_values_bitmaps_.back().get();
219  }
std::vector< std::unique_ptr< const InValuesBitmap > > in_values_bitmaps_
Definition: CgenState.h:355

+ Here is the caller graph for this function:

llvm::Value* CgenState::addStringConstant ( const std::string &  str)
inline

Definition at line 203 of file CgenState.h.

References context_, get_int_type(), ir_builder_, str_constants_, and to_string().

Referenced by CodeGenerator::codegen().

203  {
204  llvm::Value* str_lv = ir_builder_.CreateGlobalString(
205  str, "str_const_" + std::to_string(std::hash<std::string>()(str)));
206  auto i8_ptr = llvm::PointerType::get(get_int_type(8, context_), 0);
207  str_constants_.push_back(str_lv);
208  str_lv = ir_builder_.CreateBitCast(str_lv, i8_ptr);
209  return str_lv;
210  }
llvm::IRBuilder ir_builder_
Definition: CgenState.h:341
std::vector< llvm::Value * > str_constants_
Definition: CgenState.h:349
llvm::Type * get_int_type(const int width, llvm::LLVMContext &context)
std::string to_string(char const *&&v)
llvm::LLVMContext & context_
Definition: CgenState.h:339

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

llvm::Value * CgenState::castToTypeIn ( llvm::Value *  val,
const size_t  bit_width 
)

Definition at line 106 of file CgenState.cpp.

References CHECK, context_, get_int_type(), and ir_builder_.

Referenced by CodeGenerator::codegenCast(), CodeGenerator::codegenLogical(), and CodeGenerator::codegenLogicalShortCircuit().

106  {
107  auto src_bits = val->getType()->getScalarSizeInBits();
108  if (src_bits == dst_bits) {
109  return val;
110  }
111  if (val->getType()->isIntegerTy()) {
112  return ir_builder_.CreateIntCast(
113  val, get_int_type(dst_bits, context_), src_bits != 1);
114  }
115  // real (not dictionary-encoded) strings; store the pointer to the payload
116  if (val->getType()->isPointerTy()) {
117  return ir_builder_.CreatePointerCast(val, get_int_type(dst_bits, context_));
118  }
119 
120  CHECK(val->getType()->isFloatTy() || val->getType()->isDoubleTy());
121 
122  llvm::Type* dst_type = nullptr;
123  switch (dst_bits) {
124  case 64:
125  dst_type = llvm::Type::getDoubleTy(context_);
126  break;
127  case 32:
128  dst_type = llvm::Type::getFloatTy(context_);
129  break;
130  default:
131  CHECK(false);
132  }
133 
134  return ir_builder_.CreateFPCast(val, dst_type);
135 }
llvm::IRBuilder ir_builder_
Definition: CgenState.h:341
llvm::Type * get_int_type(const int width, llvm::LLVMContext &context)
llvm::LLVMContext & context_
Definition: CgenState.h:339
#define CHECK(condition)
Definition: Logger.h:197

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

llvm::Value * CgenState::emitCall ( const std::string &  fname,
const std::vector< llvm::Value * > &  args 
)

Definition at line 137 of file CgenState.cpp.

References CHECK, g_rt_module, ir_builder_, module_, and vmap_.

Referenced by CodeGenerator::codegen(), CodeGenerator::codegenAdd(), CodeGenerator::codegenCase(), CodeGenerator::codegenCast(), CodeGenerator::codegenCastBetweenIntTypes(), CodeGenerator::codegenCastBetweenIntTypesOverflowChecks(), CodeGenerator::codegenCastBetweenTimestamps(), CodeGenerator::codegenCastFromFp(), CodeGenerator::codegenCastToFp(), CodeGenerator::codegenCmp(), CodeGenerator::codegenDateTruncHighPrecisionTimestamps(), CodeGenerator::codegenDiv(), CodeGenerator::codegenExtractHighPrecisionTimestamps(), CodeGenerator::codegenFpArith(), CodeGenerator::codegenFunctionOperWithCustomTypeHandling(), CodeGenerator::codegenLogical(), CodeGenerator::codegenMod(), CodeGenerator::codegenMul(), CodeGenerator::codegenSub(), CodeGenerator::codegenUMinus(), CodeGenerator::codegenWindowPosition(), and CodeGenerator::codgenAdjustFixedEncNull().

138  {
139  // Get the implementation from the runtime module.
140  auto func_impl = g_rt_module->getFunction(fname);
141  CHECK(func_impl) << fname;
142  // Get the function reference from the query module.
143  auto func = module_->getFunction(fname);
144  CHECK(func);
145  // If the function called isn't external, clone the implementation from the runtime
146  // module.
147  if (func->isDeclaration() && !func_impl->isDeclaration()) {
148  auto DestI = func->arg_begin();
149  for (auto arg_it = func_impl->arg_begin(); arg_it != func_impl->arg_end(); ++arg_it) {
150  DestI->setName(arg_it->getName());
151  vmap_[&*arg_it] = &*DestI++;
152  }
153 
154  llvm::SmallVector<llvm::ReturnInst*, 8> Returns; // Ignore returns cloned.
155  llvm::CloneFunctionInto(func, func_impl, vmap_, /*ModuleLevelChanges=*/true, Returns);
156  }
157 
158  return ir_builder_.CreateCall(func, args);
159 }
llvm::IRBuilder ir_builder_
Definition: CgenState.h:341
llvm::Module * module_
Definition: CgenState.h:330
std::unique_ptr< llvm::Module > g_rt_module
#define CHECK(condition)
Definition: Logger.h:197
llvm::ValueToValueMapTy vmap_
Definition: CgenState.h:340

+ Here is the caller graph for this function:

void CgenState::emitErrorCheck ( llvm::Value *  condition,
llvm::Value *  errorCode,
std::string  label 
)

Definition at line 161 of file CgenState.cpp.

References context_, current_func_, ir_builder_, and needs_error_check_.

163  {
164  needs_error_check_ = true;
165  auto check_ok = llvm::BasicBlock::Create(context_, label + "_ok", current_func_);
166  auto check_fail = llvm::BasicBlock::Create(context_, label + "_fail", current_func_);
167  ir_builder_.CreateCondBr(condition, check_ok, check_fail);
168  ir_builder_.SetInsertPoint(check_fail);
169  ir_builder_.CreateRet(errorCode);
170  ir_builder_.SetInsertPoint(check_ok);
171 }
llvm::IRBuilder ir_builder_
Definition: CgenState.h:341
llvm::LLVMContext & context_
Definition: CgenState.h:339
llvm::Function * current_func_
Definition: CgenState.h:333
bool needs_error_check_
Definition: CgenState.h:356
llvm::Value* CgenState::emitExternalCall ( const std::string &  fname,
llvm::Type ret_type,
const std::vector< llvm::Value * >  args,
const std::vector< llvm::Attribute::AttrKind > &  fnattrs = {},
const bool  has_struct_return = false 
)
inline

Definition at line 222 of file CgenState.h.

Referenced by CodeGenerator::codegen(), CodeGenerator::codegenArrayAt(), CodeGenerator::codegenArrayBuff(), CodeGenerator::codegenArrayExpr(), CodeGenerator::codegenCastFromString(), CodeGenerator::codegenCastTimestampToDate(), CodeGenerator::codegenDateTruncHighPrecisionTimestamps(), CodeGenerator::codegenFunctionOper(), CodeGenerator::codegenFunctionOperCastArgs(), CodeGenerator::codegenFunctionOperNullArg(), CodeGenerator::codegenFunctionOperWithCustomTypeHandling(), CodeGenerator::codegenGeoArgs(), CodeGenerator::codegenGeosConstructorCall(), CodeGenerator::codegenGeosPredicateCall(), CodeGenerator::codegenIsNull(), CodeGenerator::codegenQualifierCmp(), CodeGenerator::codegenVariableLengthStringColVar(), and Executor::groupByColumnCodegen().

226  {},
227  const bool has_struct_return = false) {
228  std::vector<llvm::Type*> arg_types;
229  for (const auto arg : args) {
230  arg_types.push_back(arg->getType());
231  }
232  auto func_ty = llvm::FunctionType::get(ret_type, arg_types, false);
233  llvm::AttributeList attrs;
234  if (!fnattrs.empty()) {
235  std::vector<std::pair<unsigned, llvm::Attribute>> indexedAttrs;
236  indexedAttrs.reserve(fnattrs.size());
237  for (auto attr : fnattrs) {
238  indexedAttrs.emplace_back(llvm::AttributeList::FunctionIndex,
239  llvm::Attribute::get(context_, attr));
240  }
241  attrs = llvm::AttributeList::get(context_,
242  {&indexedAttrs.front(), indexedAttrs.size()});
243  }
244 
245  auto func_p = module_->getOrInsertFunction(fname, func_ty, attrs);
246  CHECK(func_p);
247 #if LLVM_VERSION_MAJOR > 8
248  auto callee = func_p.getCallee();
249 #else
250  auto callee = func_p;
251 #endif
252  llvm::Function* func{nullptr};
253  if (auto callee_cast = llvm::dyn_cast<llvm::ConstantExpr>(callee)) {
254  // Get or insert function automatically adds a ConstantExpr cast if the return type
255  // of the existing function does not match the supplied return type.
256  CHECK(callee_cast->isCast());
257  CHECK_EQ(callee_cast->getNumOperands(), size_t(1));
258  func = llvm::dyn_cast<llvm::Function>(callee_cast->getOperand(0));
259  } else {
260  func = llvm::dyn_cast<llvm::Function>(callee);
261  }
262  CHECK(func);
263 #if LLVM_VERSION_MAJOR > 8
264  llvm::FunctionType* func_type = func_p.getFunctionType();
265 #else
266  llvm::FunctionType* func_type = func->getFunctionType();
267 #endif
268  CHECK(func_type);
269  if (has_struct_return) {
270  const auto arg_ti = func_type->getParamType(0);
271  CHECK(arg_ti->isPointerTy() && arg_ti->getPointerElementType()->isStructTy());
272  auto attr_list = func->getAttributes();
273  llvm::AttrBuilder arr_arg_builder(attr_list.getParamAttributes(0));
274  arr_arg_builder.addAttribute(llvm::Attribute::StructRet);
275  func->addParamAttrs(0, arr_arg_builder);
276  }
277  const size_t arg_start = has_struct_return ? 1 : 0;
278  for (size_t i = arg_start; i < func->arg_size(); i++) {
279  const auto arg_ti = func_type->getParamType(i);
280  if (arg_ti->isPointerTy() && arg_ti->getPointerElementType()->isStructTy()) {
281  auto attr_list = func->getAttributes();
282  llvm::AttrBuilder arr_arg_builder(attr_list.getParamAttributes(i));
283 #if LLVM_VERSION_MAJOR > 8
284  arr_arg_builder.addByValAttr(arg_ti->getPointerElementType());
285 #else
286  arr_arg_builder.addAttribute(llvm::Attribute::ByVal);
287 #endif
288  func->addParamAttrs(i, arr_arg_builder);
289  }
290  }
291  llvm::Value* result = ir_builder_.CreateCall(func_p, args);
292  // check the assumed type
293  CHECK_EQ(result->getType(), ret_type);
294  return result;
295  }
#define CHECK_EQ(x, y)
Definition: Logger.h:205
llvm::IRBuilder ir_builder_
Definition: CgenState.h:341
llvm::Module * module_
Definition: CgenState.h:330
llvm::LLVMContext & context_
Definition: CgenState.h:339
#define CHECK(condition)
Definition: Logger.h:197

+ Here is the caller graph for this function:

size_t CgenState::getLiteralBufferUsage ( const int  device_id)
inline

Definition at line 299 of file CgenState.h.

References literal_bytes_.

299 { return literal_bytes_[device_id]; }
std::unordered_map< int, size_t > literal_bytes_
Definition: CgenState.h:428
const std::unordered_map<int, LiteralValues>& CgenState::getLiterals ( ) const
inline

Definition at line 201 of file CgenState.h.

References literals_.

201 { return literals_; }
std::unordered_map< int, LiteralValues > literals_
Definition: CgenState.h:427
size_t CgenState::getOrAddLiteral ( const Analyzer::Constant constant,
const EncodingType  enc_type,
const int  dict_id,
const int  device_id 
)
inline

Definition at line 62 of file CgenState.h.

References Datum::bigintval, Datum::boolval, CHECK, CHECK_EQ, decimal_to_int_type(), Datum::doubleval, Datum::floatval, Analyzer::Constant::get_constval(), Analyzer::Constant::get_is_null(), Analyzer::Expr::get_type_info(), Analyzer::Constant::get_value_list(), inline_fp_null_val(), inline_int_null_val(), Datum::intval, kARRAY, kBIGINT, kBOOLEAN, kCHAR, kDATE, kDOUBLE, kENCODING_DICT, kENCODING_GEOINT, kENCODING_NONE, kFLOAT, kINT, kINTERVAL_DAY_TIME, kINTERVAL_YEAR_MONTH, kSMALLINT, kTEXT, kTIME, kTIMESTAMP, kTINYINT, kVARCHAR, Datum::smallintval, Datum::stringval, Datum::tinyintval, and run_benchmark_import::type.

Referenced by CodeGenerator::codegenHoistedConstants().

65  {
66  const auto& ti = constant->get_type_info();
67  const auto type = ti.is_decimal() ? decimal_to_int_type(ti) : ti.get_type();
68  switch (type) {
69  case kBOOLEAN:
70  return getOrAddLiteral(constant->get_is_null()
71  ? int8_t(inline_int_null_val(ti))
72  : int8_t(constant->get_constval().boolval ? 1 : 0),
73  device_id);
74  case kTINYINT:
75  return getOrAddLiteral(constant->get_is_null()
76  ? int8_t(inline_int_null_val(ti))
77  : constant->get_constval().tinyintval,
78  device_id);
79  case kSMALLINT:
80  return getOrAddLiteral(constant->get_is_null()
81  ? int16_t(inline_int_null_val(ti))
82  : constant->get_constval().smallintval,
83  device_id);
84  case kINT:
85  return getOrAddLiteral(constant->get_is_null() ? int32_t(inline_int_null_val(ti))
86  : constant->get_constval().intval,
87  device_id);
88  case kBIGINT:
89  return getOrAddLiteral(constant->get_is_null()
90  ? int64_t(inline_int_null_val(ti))
91  : constant->get_constval().bigintval,
92  device_id);
93  case kFLOAT:
94  return getOrAddLiteral(constant->get_is_null()
95  ? float(inline_fp_null_val(ti))
96  : constant->get_constval().floatval,
97  device_id);
98  case kDOUBLE:
99  return getOrAddLiteral(constant->get_is_null()
100  ? inline_fp_null_val(ti)
101  : constant->get_constval().doubleval,
102  device_id);
103  case kCHAR:
104  case kTEXT:
105  case kVARCHAR:
106  if (enc_type == kENCODING_DICT) {
107  if (constant->get_is_null()) {
108  return getOrAddLiteral(int32_t(inline_int_null_val(ti)), device_id);
109  }
110  return getOrAddLiteral(
111  std::make_pair(*constant->get_constval().stringval, dict_id), device_id);
112  }
113  CHECK_EQ(kENCODING_NONE, enc_type);
114  if (constant->get_is_null()) {
115  throw std::runtime_error(
116  "CHAR / VARCHAR NULL literal not supported in this context"); // TODO(alex):
117  // support
118  // null
119  }
120  return getOrAddLiteral(*constant->get_constval().stringval, device_id);
121  case kTIME:
122  case kTIMESTAMP:
123  case kDATE:
124  case kINTERVAL_DAY_TIME:
126  // TODO(alex): support null
127  return getOrAddLiteral(constant->get_constval().bigintval, device_id);
128  case kARRAY: {
129  if (enc_type == kENCODING_NONE) {
130  if (ti.get_subtype() == kDOUBLE) {
131  std::vector<double> double_array_literal;
132  for (const auto& value : constant->get_value_list()) {
133  const auto c = dynamic_cast<const Analyzer::Constant*>(value.get());
134  CHECK(c);
135  double d = c->get_constval().doubleval;
136  double_array_literal.push_back(d);
137  }
138  return getOrAddLiteral(double_array_literal, device_id);
139  }
140  if (ti.get_subtype() == kINT) {
141  std::vector<int32_t> int32_array_literal;
142  for (const auto& value : constant->get_value_list()) {
143  const auto c = dynamic_cast<const Analyzer::Constant*>(value.get());
144  CHECK(c);
145  int32_t i = c->get_constval().intval;
146  int32_array_literal.push_back(i);
147  }
148  return getOrAddLiteral(int32_array_literal, device_id);
149  }
150  if (ti.get_subtype() == kTINYINT) {
151  std::vector<int8_t> int8_array_literal;
152  for (const auto& value : constant->get_value_list()) {
153  const auto c = dynamic_cast<const Analyzer::Constant*>(value.get());
154  CHECK(c);
155  int8_t i = c->get_constval().tinyintval;
156  int8_array_literal.push_back(i);
157  }
158  if (ti.get_comp_param() == 64) {
159  return getOrAddLiteral(std::make_pair(int8_array_literal, 64), device_id);
160  }
161  return getOrAddLiteral(int8_array_literal, device_id);
162  }
163  throw std::runtime_error("Unsupported literal array");
164  }
165  if (enc_type == kENCODING_GEOINT) {
166  if (ti.get_subtype() == kTINYINT) {
167  std::vector<int8_t> int8_array_literal;
168  for (const auto& value : constant->get_value_list()) {
169  const auto c = dynamic_cast<const Analyzer::Constant*>(value.get());
170  CHECK(c);
171  int8_t i = c->get_constval().tinyintval;
172  int8_array_literal.push_back(i);
173  }
174  if (ti.get_comp_param() == 32) {
175  return getOrAddLiteral(std::make_pair(int8_array_literal, 32), device_id);
176  }
177  return getOrAddLiteral(int8_array_literal, device_id);
178  }
179  }
180  throw std::runtime_error("Encoded literal arrays are not supported");
181  }
182  default:
183  abort();
184  }
185  }
const std::list< std::shared_ptr< Analyzer::Expr > > & get_value_list() const
Definition: Analyzer.h:337
#define CHECK_EQ(x, y)
Definition: Logger.h:205
Definition: sqltypes.h:51
bool get_is_null() const
Definition: Analyzer.h:334
double inline_fp_null_val(const SQL_TYPE_INFO &ti)
size_t getOrAddLiteral(const Analyzer::Constant *constant, const EncodingType enc_type, const int dict_id, const int device_id)
Definition: CgenState.h:62
int64_t bigintval
Definition: sqltypes.h:138
const SQLTypeInfo & get_type_info() const
Definition: Analyzer.h:78
std::string * stringval
Definition: sqltypes.h:143
SQLTypes decimal_to_int_type(const SQLTypeInfo &ti)
Definition: Datum.cpp:302
Definition: sqltypes.h:54
Definition: sqltypes.h:55
Datum get_constval() const
Definition: Analyzer.h:335
Definition: sqltypes.h:43
#define CHECK(condition)
Definition: Logger.h:197
int64_t inline_int_null_val(const SQL_TYPE_INFO &ti)
Definition: sqltypes.h:47

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<class T >
size_t CgenState::getOrAddLiteral ( const T &  val,
const int  device_id 
)
inlineprivate

Definition at line 410 of file CgenState.h.

References addAligned(), literal_bytes_, literalBytes(), literals, and literals_.

410  {
411  const LiteralValue var_val(val);
412  size_t literal_found_off{0};
413  auto& literals = literals_[device_id];
414  for (const auto& literal : literals) {
415  const auto lit_bytes = literalBytes(literal);
416  literal_found_off = addAligned(literal_found_off, lit_bytes);
417  if (literal == var_val) {
418  return literal_found_off - lit_bytes;
419  }
420  }
421  literals.emplace_back(val);
422  const auto lit_bytes = literalBytes(var_val);
423  literal_bytes_[device_id] = addAligned(literal_bytes_[device_id], lit_bytes);
424  return literal_bytes_[device_id] - lit_bytes;
425  }
static size_t literalBytes(const CgenState::LiteralValue &lit)
Definition: CgenState.h:369
boost::variant< int8_t, int16_t, int32_t, int64_t, float, double, std::pair< std::string, int >, std::string, std::vector< double >, std::vector< int32_t >, std::vector< int8_t >, std::pair< std::vector< int8_t >, int >> LiteralValue
Definition: CgenState.h:198
static size_t addAligned(const size_t off_in, const size_t alignment)
Definition: CgenState.h:400
std::unordered_map< int, size_t > literal_bytes_
Definition: CgenState.h:428
std::unordered_map< int, LiteralValues > literals_
Definition: CgenState.h:427
const int8_t * literals

+ Here is the call graph for this function:

llvm::ConstantFP * CgenState::inlineFpNull ( const SQLTypeInfo type_info)

Definition at line 65 of file CgenState.cpp.

References CHECK, SQLTypeInfo::get_type(), SQLTypeInfo::is_fp(), kDOUBLE, kFLOAT, llFp(), NULL_DOUBLE, and NULL_FLOAT.

Referenced by CodeGenerator::codegenArrayAt(), CodeGenerator::codegenCastFromFp(), CodeGenerator::codegenCastToFp(), CodeGenerator::codegenFixedLengthColVarInWindow(), CodeGenerator::codegenUMinus(), CodeGenerator::endArgsNullcheck(), and CodeGenerator::NullCheckCodegen::NullCheckCodegen().

65  {
66  CHECK(type_info.is_fp());
67  switch (type_info.get_type()) {
68  case kFLOAT:
69  return llFp(NULL_FLOAT);
70  case kDOUBLE:
71  return llFp(NULL_DOUBLE);
72  default:
73  abort();
74  }
75 }
#define NULL_DOUBLE
Definition: sqltypes.h:186
bool is_fp() const
Definition: sqltypes.h:421
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:259
#define NULL_FLOAT
Definition: sqltypes.h:185
llvm::ConstantFP * llFp(const float v) const
Definition: CgenState.h:316
#define CHECK(condition)
Definition: Logger.h:197

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::pair< llvm::ConstantInt *, llvm::ConstantInt * > CgenState::inlineIntMaxMin ( const size_t  byte_width,
const bool  is_signed 
)

Definition at line 77 of file CgenState.cpp.

References CHECK_EQ, context_, inline_int_max_min(), inline_uint_max_min(), and ll_int().

Referenced by CodeGenerator::codegenAdd(), CodeGenerator::codegenCastBetweenIntTypesOverflowChecks(), CodeGenerator::codegenDiv(), CodeGenerator::codegenMul(), CodeGenerator::codegenSub(), and CodeGenerator::codegenUMinus().

79  {
80  int64_t max_int{0}, min_int{0};
81  if (is_signed) {
82  std::tie(max_int, min_int) = inline_int_max_min(byte_width);
83  } else {
84  uint64_t max_uint{0}, min_uint{0};
85  std::tie(max_uint, min_uint) = inline_uint_max_min(byte_width);
86  max_int = static_cast<int64_t>(max_uint);
87  CHECK_EQ(uint64_t(0), min_uint);
88  }
89  switch (byte_width) {
90  case 1:
91  return std::make_pair(::ll_int(static_cast<int8_t>(max_int), context_),
92  ::ll_int(static_cast<int8_t>(min_int), context_));
93  case 2:
94  return std::make_pair(::ll_int(static_cast<int16_t>(max_int), context_),
95  ::ll_int(static_cast<int16_t>(min_int), context_));
96  case 4:
97  return std::make_pair(::ll_int(static_cast<int32_t>(max_int), context_),
98  ::ll_int(static_cast<int32_t>(min_int), context_));
99  case 8:
100  return std::make_pair(::ll_int(max_int, context_), ::ll_int(min_int, context_));
101  default:
102  abort();
103  }
104 }
#define CHECK_EQ(x, y)
Definition: Logger.h:205
llvm::ConstantInt * ll_int(const T v, llvm::LLVMContext &context)
llvm::LLVMContext & context_
Definition: CgenState.h:339
std::pair< uint64_t, uint64_t > inline_uint_max_min(const size_t byte_width)
std::pair< int64_t, int64_t > inline_int_max_min(const size_t byte_width)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

llvm::ConstantInt * CgenState::inlineIntNull ( const SQLTypeInfo type_info)

Definition at line 27 of file CgenState.cpp.

References CHECK, SQLTypeInfo::get_compression(), SQLTypeInfo::get_type(), inline_int_null_val(), SQLTypeInfo::is_string(), kARRAY, kBIGINT, kBOOLEAN, kDATE, kDECIMAL, kENCODING_DICT, kENCODING_NONE, kINT, kINTERVAL_DAY_TIME, kINTERVAL_YEAR_MONTH, kNUMERIC, kSMALLINT, kTIME, kTIMESTAMP, kTINYINT, llInt(), and run_benchmark_import::type.

Referenced by CodeGenerator::codegen(), CodeGenerator::codegenArrayAt(), CodeGenerator::codegenCastBetweenIntTypes(), CodeGenerator::codegenCastBetweenIntTypesOverflowChecks(), CodeGenerator::codegenCastBetweenTimestamps(), CodeGenerator::codegenCastFromFp(), CodeGenerator::codegenCastTimestampToDate(), CodeGenerator::codegenCastToFp(), CodeGenerator::codegenDateTruncHighPrecisionTimestamps(), CodeGenerator::codegenDiv(), CodeGenerator::codegenExtractHighPrecisionTimestamps(), CodeGenerator::codegenFixedLengthColVarInWindow(), CodeGenerator::codegenIntConst(), CodeGenerator::codegenIsNullNumber(), CodeGenerator::codegenLogical(), CodeGenerator::codegenLogicalShortCircuit(), CodeGenerator::codegenQualifierCmp(), CodeGenerator::codegenUMinus(), CodeGenerator::codgenAdjustFixedEncNull(), CodeGenerator::endArgsNullcheck(), and CodeGenerator::NullCheckCodegen::NullCheckCodegen().

27  {
28  auto type = type_info.get_type();
29  if (type_info.is_string()) {
30  switch (type_info.get_compression()) {
31  case kENCODING_DICT:
32  return llInt(static_cast<int32_t>(inline_int_null_val(type_info)));
33  case kENCODING_NONE:
34  return llInt(int64_t(0));
35  default:
36  CHECK(false);
37  }
38  }
39  switch (type) {
40  case kBOOLEAN:
41  return llInt(static_cast<int8_t>(inline_int_null_val(type_info)));
42  case kTINYINT:
43  return llInt(static_cast<int8_t>(inline_int_null_val(type_info)));
44  case kSMALLINT:
45  return llInt(static_cast<int16_t>(inline_int_null_val(type_info)));
46  case kINT:
47  return llInt(static_cast<int32_t>(inline_int_null_val(type_info)));
48  case kBIGINT:
49  case kTIME:
50  case kTIMESTAMP:
51  case kDATE:
52  case kINTERVAL_DAY_TIME:
54  return llInt(inline_int_null_val(type_info));
55  case kDECIMAL:
56  case kNUMERIC:
57  return llInt(inline_int_null_val(type_info));
58  case kARRAY:
59  return llInt(int64_t(0));
60  default:
61  abort();
62  }
63 }
Definition: sqltypes.h:51
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:259
Definition: sqltypes.h:55
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:267
llvm::ConstantInt * llInt(const T v) const
Definition: CgenState.h:312
#define CHECK(condition)
Definition: Logger.h:197
int64_t inline_int_null_val(const SQL_TYPE_INFO &ti)
Definition: sqltypes.h:47
bool is_string() const
Definition: sqltypes.h:417

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static size_t CgenState::literalBytes ( const CgenState::LiteralValue lit)
inlinestatic

Definition at line 369 of file CgenState.h.

Referenced by CodeGenerator::codegenHoistedConstantsLoads(), getOrAddLiteral(), and Executor::serializeLiterals().

369  {
370  switch (lit.which()) {
371  case 0:
372  return 1; // int8_t
373  case 1:
374  return 2; // int16_t
375  case 2:
376  return 4; // int32_t
377  case 3:
378  return 8; // int64_t
379  case 4:
380  return 4; // float
381  case 5:
382  return 8; // double
383  case 6:
384  return 4; // std::pair<std::string, int>
385  case 7:
386  return 4; // std::string
387  case 8:
388  return 4; // std::vector<double>
389  case 9:
390  return 4; // std::vector<int32_t>
391  case 10:
392  return 4; // std::vector<int8_t>
393  case 11:
394  return 4; // std::pair<std::vector<int8_t>, int>
395  default:
396  abort();
397  }
398  }

+ Here is the caller graph for this function:

llvm::ConstantInt* CgenState::llBool ( const bool  v) const
inline

Definition at line 326 of file CgenState.h.

References context_, and ll_bool().

Referenced by Executor::buildIsDeletedCb(), Executor::buildJoinLoops(), CodeGenerator::codegenGeosConstructorCall(), and CodeGenerator::codegenGeosPredicateCall().

326 { return ::ll_bool(v, context_); }
llvm::LLVMContext & context_
Definition: CgenState.h:339
llvm::ConstantInt * ll_bool(const bool v, llvm::LLVMContext &context)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

llvm::ConstantFP* CgenState::llFp ( const float  v) const
inline

Definition at line 316 of file CgenState.h.

References context_.

Referenced by CodeGenerator::codegenDiv(), CodeGenerator::codegenFpArith(), CodeGenerator::codegenIsNullNumber(), and inlineFpNull().

316  {
317  return static_cast<llvm::ConstantFP*>(
318  llvm::ConstantFP::get(llvm::Type::getFloatTy(context_), v));
319  }
llvm::LLVMContext & context_
Definition: CgenState.h:339

+ Here is the caller graph for this function:

llvm::ConstantFP* CgenState::llFp ( const double  v) const
inline

Definition at line 321 of file CgenState.h.

References context_.

321  {
322  return static_cast<llvm::ConstantFP*>(
323  llvm::ConstantFP::get(llvm::Type::getDoubleTy(context_), v));
324  }
llvm::LLVMContext & context_
Definition: CgenState.h:339
template<class T >
llvm::ConstantInt* CgenState::llInt ( const T  v) const
inline

Definition at line 312 of file CgenState.h.

References context_, and ll_int().

Referenced by Executor::buildIsDeletedCb(), CodeGenerator::codegen(), CodeGenerator::codegenAdd(), CodeGenerator::codegenArrayExpr(), CodeGenerator::codegenBinOpWithOverflowForCPU(), CodeGenerator::codegenCastBetweenIntTypes(), CodeGenerator::codegenCastBetweenIntTypesOverflowChecks(), CodeGenerator::codegenCastBetweenTimestamps(), CodeGenerator::codegenCastFromString(), CodeGenerator::codegenCastTimestampToDate(), CodeGenerator::codegenCompression(), CodeGenerator::codegenDateTruncHighPrecisionTimestamps(), CodeGenerator::codegenDiv(), CodeGenerator::codegenExtractHighPrecisionTimestamps(), CodeGenerator::codegenFixedLengthColVarInWindow(), CodeGenerator::codegenFunctionOper(), CodeGenerator::codegenFunctionOperCastArgs(), CodeGenerator::codegenFunctionOperWithCustomTypeHandling(), CodeGenerator::codegenGeoArgs(), CodeGenerator::codegenGeoBinOper(), CodeGenerator::codegenGeosConstructorCall(), CodeGenerator::codegenGeosPredicateCall(), CodeGenerator::codegenGeoUOper(), CodeGenerator::codegenHoistedConstantsLoads(), CodeGenerator::codegenHoistedConstantsPlaceholders(), CodeGenerator::codegenIntConst(), Executor::codegenJoinLoops(), CodeGenerator::codegenMod(), CodeGenerator::codegenMul(), CodeGenerator::codegenQualifierCmp(), CodeGenerator::codegenRowId(), CodeGenerator::codegenSub(), CodeGenerator::codegenUMinus(), CodeGenerator::codegenWindowPosition(), CodeGenerator::codgenAdjustFixedEncNull(), Executor::groupByColumnCodegen(), and inlineIntNull().

312  {
314  }
llvm::ConstantInt * ll_int(const T v, llvm::LLVMContext &context)
llvm::LLVMContext & context_
Definition: CgenState.h:339

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

const bool CgenState::contains_left_deep_outer_join_

Definition at line 351 of file CgenState.h.

llvm::LLVMContext& CgenState::context_

Definition at line 339 of file CgenState.h.

Referenced by addStringConstant(), CodeGenerator::beginArgsNullcheck(), Executor::buildIsDeletedCb(), CodeGenerator::castArrayPointer(), castToTypeIn(), CodeGenerator::codegen(), CodeGenerator::codegenAdd(), CodeGenerator::codegenArrayArgs(), CodeGenerator::codegenArrayAt(), CodeGenerator::codegenArrayBuff(), CodeGenerator::codegenArrayExpr(), CodeGenerator::codegenBinOpWithOverflowForCPU(), CodeGenerator::codegenCase(), CodeGenerator::codegenCast(), CodeGenerator::codegenCastBetweenIntTypes(), CodeGenerator::codegenCastBetweenIntTypesOverflowChecks(), CodeGenerator::codegenCastFromFp(), CodeGenerator::codegenCastFromString(), CodeGenerator::codegenCastTimestampToDate(), CodeGenerator::codegenCastToFp(), CodeGenerator::codegenDateTruncHighPrecisionTimestamps(), CodeGenerator::codegenDiv(), CodeGenerator::codegenFixedLengthColVar(), CodeGenerator::codegenFixedLengthColVarInWindow(), CodeGenerator::codegenFunctionOper(), CodeGenerator::codegenFunctionOperCastArgs(), CodeGenerator::codegenFunctionOperNullArg(), CodeGenerator::codegenFunctionOperWithCustomTypeHandling(), CodeGenerator::codegenGeoArgs(), CodeGenerator::codegenGeoBinOper(), CodeGenerator::codegenGeosConstructorCall(), CodeGenerator::codegenGeosPredicateCall(), CodeGenerator::codegenGeoUOper(), CodeGenerator::codegenHoistedConstantsLoads(), CodeGenerator::codegenIsNull(), Executor::codegenJoinLoops(), CodeGenerator::codegenLogicalShortCircuit(), CodeGenerator::codegenMod(), CodeGenerator::codegenMul(), CodeGenerator::codegenOuterJoinNullPlaceholder(), CodeGenerator::codegenQualifierCmp(), CodeGenerator::codegenSkipOverflowCheckForNull(), CodeGenerator::codegenSub(), CodeGenerator::codegenUMinus(), CodeGenerator::codegenVariableLengthStringColVar(), CodeGenerator::codgenAdjustFixedEncNull(), CodeGenerator::colByteStream(), anonymous_namespace{ResultSetReductionCodegen.cpp}::create_entry_block(), anonymous_namespace{ResultSetReductionJIT.cpp}::create_llvm_function(), anonymous_namespace{ResultSetReductionInterpreterStubs.cpp}::create_stub_function(), emitErrorCheck(), CodeGenerator::endArgsNullcheck(), anonymous_namespace{TableFunctionCompilationContext.cpp}::generate_entry_point(), anonymous_namespace{ExtensionsIR.cpp}::get_arr_struct_type(), Executor::groupByColumnCodegen(), inlineIntMaxMin(), llBool(), llFp(), llInt(), AutomaticIRMetadataGuard::markInstructions(), CodeGenerator::NullCheckCodegen::NullCheckCodegen(), CodeGenerator::posArg(), and Executor::redeclareFilterFunction().

std::vector<FunctionOperValue> CgenState::ext_call_cache_

Definition at line 347 of file CgenState.h.

Referenced by CodeGenerator::codegenFunctionOper().

std::unordered_map<int, std::vector<llvm::Value*> > CgenState::fetch_cache_
llvm::Function* CgenState::filter_func_

Definition at line 332 of file CgenState.h.

Referenced by Executor::redeclareFilterFunction().

InsertionOrderedMap CgenState::filter_func_args_

Definition at line 354 of file CgenState.h.

Referenced by Executor::redeclareFilterFunction().

llvm::BasicBlock* CgenState::filter_func_bb_

Definition at line 335 of file CgenState.h.

llvm::CallInst* CgenState::filter_func_call_

Definition at line 337 of file CgenState.h.

std::vector<llvm::Value*> CgenState::frag_offsets_

Definition at line 350 of file CgenState.h.

Referenced by CodeGenerator::codegenColVar(), and CodeGenerator::codegenRowId().

std::vector<llvm::Value*> CgenState::group_by_expr_cache_

Definition at line 348 of file CgenState.h.

Referenced by CodeGenerator::resolveGroupedColumnReference().

std::vector<llvm::Function*> CgenState::helper_functions_

Definition at line 338 of file CgenState.h.

std::vector<std::unique_ptr<const InValuesBitmap> > CgenState::in_values_bitmaps_

Definition at line 355 of file CgenState.h.

Referenced by addInValuesBitmap().

llvm::IRBuilder CgenState::ir_builder_

Definition at line 341 of file CgenState.h.

Referenced by addStringConstant(), CodeGenerator::beginArgsNullcheck(), Executor::buildIsDeletedCb(), Executor::buildJoinLoops(), CodeGenerator::castArrayPointer(), castToTypeIn(), JoinLoop::codegen(), CodeGenerator::codegen(), CodeGenerator::codegenAdd(), CodeGenerator::codegenArrayArgs(), CodeGenerator::codegenArrayAt(), CodeGenerator::codegenArrayExpr(), CodeGenerator::codegenBinOpWithOverflowForCPU(), CodeGenerator::codegenCase(), CodeGenerator::codegenCast(), CodeGenerator::codegenCastBetweenIntTypes(), CodeGenerator::codegenCastBetweenIntTypesOverflowChecks(), CodeGenerator::codegenCastBetweenTimestamps(), CodeGenerator::codegenCastFromFp(), CodeGenerator::codegenCastToFp(), CodeGenerator::codegenColVar(), CodeGenerator::codegenDateTruncHighPrecisionTimestamps(), CodeGenerator::codegenDiv(), CodeGenerator::codegenExtractHighPrecisionTimestamps(), CodeGenerator::codegenFixedLengthColVar(), CodeGenerator::codegenFixedLengthColVarInWindow(), CodeGenerator::codegenFpArith(), CodeGenerator::codegenFunctionOper(), CodeGenerator::codegenFunctionOperCastArgs(), CodeGenerator::codegenFunctionOperNullArg(), CodeGenerator::codegenFunctionOperWithCustomTypeHandling(), CodeGenerator::codegenGeoArgs(), CodeGenerator::codegenGeoLineStringArgs(), CodeGenerator::codegenGeoMultiPolygonArgs(), CodeGenerator::codegenGeoPointArgs(), CodeGenerator::codegenGeoPolygonArgs(), CodeGenerator::codegenGeosConstructorCall(), CodeGenerator::codegenGeosPredicateCall(), CodeGenerator::codegenHoistedConstantsPlaceholders(), CodeGenerator::codegenIsNullNumber(), Executor::codegenJoinLoops(), CodeGenerator::codegenLogical(), CodeGenerator::codegenLogicalShortCircuit(), CodeGenerator::codegenMod(), CodeGenerator::codegenMul(), CodeGenerator::codegenOuterJoinNullPlaceholder(), CodeGenerator::codegenRowId(), CodeGenerator::codegenSkipOverflowCheckForNull(), CodeGenerator::codegenSub(), CodeGenerator::codegenUMinus(), CodeGenerator::codgenAdjustFixedEncNull(), ScalarCodeGenerator::compile(), anonymous_namespace{ResultSetReductionCodegen.cpp}::create_entry_block(), anonymous_namespace{ResultSetReductionInterpreterStubs.cpp}::create_stub_function(), emitCall(), emitErrorCheck(), CodeGenerator::endArgsNullcheck(), JoinLoop::evaluateOuterJoinCondition(), Executor::groupByColumnCodegen(), CodeGenerator::NullCheckCodegen::NullCheckCodegen(), CodeGenerator::posArg(), and CodeGenerator::toBool().

std::unordered_map<int, size_t> CgenState::literal_bytes_
private

Definition at line 428 of file CgenState.h.

Referenced by getLiteralBufferUsage(), and getOrAddLiteral().

std::unordered_map<int, LiteralValues> CgenState::literals_
private

Definition at line 427 of file CgenState.h.

Referenced by getLiterals(), and getOrAddLiteral().

bool CgenState::needs_geos_
std::vector<llvm::Value*> CgenState::outer_join_match_found_per_level_
llvm::Function* CgenState::query_func_

Definition at line 359 of file CgenState.h.

Referenced by CodeGenerator::codegenHoistedConstantsLoads().

llvm::IRBuilder CgenState::query_func_entry_ir_builder_

Definition at line 360 of file CgenState.h.

Referenced by CodeGenerator::codegenHoistedConstantsLoads().

std::unordered_map<int, std::vector<llvm::Value*> > CgenState::query_func_literal_loads_

Definition at line 361 of file CgenState.h.

Referenced by CodeGenerator::codegenHoistedConstants().

llvm::BasicBlock* CgenState::row_func_bb_

Definition at line 334 of file CgenState.h.

llvm::CallInst* CgenState::row_func_call_

Definition at line 336 of file CgenState.h.

std::unordered_map<llvm::Value*, HoistedLiteralLoadLocator> CgenState::row_func_hoisted_literals_

Definition at line 367 of file CgenState.h.

Referenced by CodeGenerator::codegenHoistedConstantsPlaceholders().

std::unordered_map<int, llvm::Value*> CgenState::scan_idx_to_hash_pos_

Definition at line 353 of file CgenState.h.

Referenced by Executor::addJoinLoopIterator(), and CodeGenerator::posArg().

std::vector<llvm::Value*> CgenState::str_constants_

Definition at line 349 of file CgenState.h.

Referenced by addStringConstant().

llvm::ValueToValueMapTy CgenState::vmap_

Definition at line 340 of file CgenState.h.

Referenced by emitCall(), and CodeGenerator::link_udf_module().


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