OmniSciDB  085a039ca4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
anonymous_namespace{TableFunctionCompilationContext.cpp} Namespace Reference

Functions

llvm::Function * generate_entry_point (const CgenState *cgen_state)
 
llvm::Typeget_llvm_type_from_sql_column_type (const SQLTypeInfo elem_ti, llvm::LLVMContext &ctx)
 
std::tuple< llvm::Value
*, llvm::Value * > 
alloc_column (std::string col_name, const size_t index, const SQLTypeInfo &data_target_info, llvm::Value *data_ptr, llvm::Value *data_size, llvm::Value *data_str_dict_proxy_ptr, llvm::LLVMContext &ctx, llvm::IRBuilder<> &ir_builder)
 
llvm::Value * alloc_column_list (std::string col_list_name, const SQLTypeInfo &data_target_info, llvm::Value *data_ptrs, int length, llvm::Value *data_size, llvm::Value *data_str_dict_proxy_ptrs, llvm::LLVMContext &ctx, llvm::IRBuilder<> &ir_builder)
 
static bool columnTypeRequiresCasting (const SQLTypeInfo &ti)
 
llvm::Value * cast_value (llvm::Value *value, SQLTypeInfo &orig_ti, SQLTypeInfo &dest_ti, bool nullable, CodeGenerator &codeGenerator)
 
void cast_column (llvm::Value *col_base_ptr, llvm::Function *func, SQLTypeInfo &orig_ti, SQLTypeInfo &dest_ti, std::string index, llvm::IRBuilder<> &ir_builder, llvm::LLVMContext &ctx, CodeGenerator &codeGenerator)
 
std::string exprsKey (const std::vector< Analyzer::Expr * > &exprs)
 

Function Documentation

std::tuple<llvm::Value*, llvm::Value*> anonymous_namespace{TableFunctionCompilationContext.cpp}::alloc_column ( std::string  col_name,
const size_t  index,
const SQLTypeInfo data_target_info,
llvm::Value *  data_ptr,
llvm::Value *  data_size,
llvm::Value *  data_str_dict_proxy_ptr,
llvm::LLVMContext &  ctx,
llvm::IRBuilder<> &  ir_builder 
)

Definition at line 87 of file TableFunctionCompilationContext.cpp.

References CHECK, SQLTypeInfo::get_compression(), get_llvm_type_from_sql_column_type(), SQLTypeInfo::is_string(), and kENCODING_DICT.

Referenced by TableFunctionCompilationContext::generateEntryPoint().

94  {
95  /*
96  Creates a new Column instance of given element type and initialize
97  its data ptr and sz members when specified. If data ptr or sz are
98  unspecified (have nullptr values) then the corresponding members
99  are initialized with NULL and -1, respectively.
100 
101  If we are allocating a TextEncodingDict Column type, this function
102  adds and populates a int8* pointer to a StringDictProxy object.
103 
104  Return a pair of Column allocation (caller should apply
105  builder.CreateLoad to it in order to construct a Column instance
106  as a value) and a pointer to the Column instance.
107  */
108  llvm::Type* data_ptr_llvm_type =
109  get_llvm_type_from_sql_column_type(data_target_info, ctx);
110  const bool is_text_encoding_dict_type =
111  data_target_info.is_string() &&
112  data_target_info.get_compression() == kENCODING_DICT;
113 
114  llvm::StructType* col_struct_type =
115  is_text_encoding_dict_type
116  ? llvm::StructType::get(
117  ctx,
118  {
119  data_ptr_llvm_type, /* T* ptr */
120  llvm::Type::getInt64Ty(ctx), /* int64_t sz */
121  llvm::Type::getInt8PtrTy(ctx) /* int64_t string_dictionary_ptr */
122  })
123  : llvm::StructType::get(ctx,
124  {
125  data_ptr_llvm_type, /* T* ptr */
126  llvm::Type::getInt64Ty(ctx) /* int64_t sz */
127  });
128  auto col = ir_builder.CreateAlloca(col_struct_type);
129  col->setName(col_name);
130  auto col_ptr_ptr = ir_builder.CreateStructGEP(col_struct_type, col, 0);
131  auto col_sz_ptr = ir_builder.CreateStructGEP(col_struct_type, col, 1);
132  auto col_str_dict_ptr = is_text_encoding_dict_type
133  ? ir_builder.CreateStructGEP(col_struct_type, col, 2)
134  : nullptr;
135  col_ptr_ptr->setName(col_name + ".ptr");
136  col_sz_ptr->setName(col_name + ".sz");
137  if (is_text_encoding_dict_type) {
138  col_str_dict_ptr->setName(col_name + ".string_dict_proxy");
139  }
140 
141  if (data_ptr != nullptr) {
142  if (data_ptr->getType() == data_ptr_llvm_type->getPointerElementType()) {
143  ir_builder.CreateStore(data_ptr, col_ptr_ptr);
144  } else {
145  auto tmp = ir_builder.CreateBitCast(data_ptr, data_ptr_llvm_type);
146  ir_builder.CreateStore(tmp, col_ptr_ptr);
147  }
148  } else {
149  ir_builder.CreateStore(llvm::Constant::getNullValue(data_ptr_llvm_type), col_ptr_ptr);
150  }
151  llvm::Value* size_val = nullptr;
152  if (data_size != nullptr) {
153  auto data_size_type = data_size->getType();
154  if (data_size_type->isPointerTy()) {
155  CHECK(data_size_type->getPointerElementType()->isIntegerTy(64));
156  size_val =
157  ir_builder.CreateLoad(data_size->getType()->getPointerElementType(), data_size);
158  } else {
159  CHECK(data_size_type->isIntegerTy(64));
160  size_val = data_size;
161  }
162  ir_builder.CreateStore(size_val, col_sz_ptr);
163  } else {
164  auto const_minus1 = llvm::ConstantInt::get(llvm::Type::getInt64Ty(ctx), -1, true);
165  ir_builder.CreateStore(const_minus1, col_sz_ptr);
166  }
167  if (is_text_encoding_dict_type) {
168  if (data_str_dict_proxy_ptr != nullptr) {
169  auto data_str_dict_proxy_type = data_str_dict_proxy_ptr->getType();
170  CHECK(data_str_dict_proxy_type->getPointerElementType()->isIntegerTy(8));
171  ir_builder.CreateStore(data_str_dict_proxy_ptr, col_str_dict_ptr);
172  } else {
173  ir_builder.CreateStore(llvm::Constant::getNullValue(llvm::Type::getInt8PtrTy(ctx)),
174  col_str_dict_ptr);
175  }
176  }
177 
178  auto col_ptr = ir_builder.CreatePointerCast(
179  col_ptr_ptr, llvm::PointerType::get(llvm::Type::getInt8Ty(ctx), 0));
180  col_ptr->setName(col_name + "_ptr");
181  return {col, col_ptr};
182 }
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:337
llvm::Type * get_llvm_type_from_sql_column_type(const SQLTypeInfo elem_ti, llvm::LLVMContext &ctx)
#define CHECK(condition)
Definition: Logger.h:223
bool is_string() const
Definition: sqltypes.h:510

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

llvm::Value* anonymous_namespace{TableFunctionCompilationContext.cpp}::alloc_column_list ( std::string  col_list_name,
const SQLTypeInfo data_target_info,
llvm::Value *  data_ptrs,
int  length,
llvm::Value *  data_size,
llvm::Value *  data_str_dict_proxy_ptrs,
llvm::LLVMContext &  ctx,
llvm::IRBuilder<> &  ir_builder 
)

Definition at line 184 of file TableFunctionCompilationContext.cpp.

References CHECK, SQLTypeInfo::get_compression(), SQLTypeInfo::is_string(), and kENCODING_DICT.

Referenced by TableFunctionCompilationContext::generateEntryPoint().

191  {
192  /*
193  Creates a new ColumnList instance of given element type and initialize
194  its members. If data ptr or size are unspecified (have nullptr
195  values) then the corresponding members are initialized with NULL
196  and -1, respectively.
197  */
198  llvm::Type* data_ptrs_llvm_type = llvm::Type::getInt8PtrTy(ctx);
199  const bool is_text_encoding_dict_type =
200  data_target_info.is_string() &&
201  data_target_info.get_compression() == kENCODING_DICT;
202 
203  llvm::StructType* col_list_struct_type =
204  is_text_encoding_dict_type
205  ? llvm::StructType::get(
206  ctx,
207  {
208  data_ptrs_llvm_type, /* int8_t* ptrs */
209  llvm::Type::getInt64Ty(ctx), /* int64_t length */
210  llvm::Type::getInt64Ty(ctx), /* int64_t size */
211  data_ptrs_llvm_type /* int8_t* str_dict_proxy_ptrs */
212  })
213  : llvm::StructType::get(ctx,
214  {
215  data_ptrs_llvm_type, /* int8_t* ptrs */
216  llvm::Type::getInt64Ty(ctx), /* int64_t length */
217  llvm::Type::getInt64Ty(ctx) /* int64_t size */
218  });
219 
220  auto col_list = ir_builder.CreateAlloca(col_list_struct_type);
221  col_list->setName(col_list_name);
222  auto col_list_ptr_ptr = ir_builder.CreateStructGEP(col_list_struct_type, col_list, 0);
223  auto col_list_length_ptr =
224  ir_builder.CreateStructGEP(col_list_struct_type, col_list, 1);
225  auto col_list_size_ptr = ir_builder.CreateStructGEP(col_list_struct_type, col_list, 2);
226  auto col_str_dict_ptr_ptr =
227  is_text_encoding_dict_type
228  ? ir_builder.CreateStructGEP(col_list_struct_type, col_list, 3)
229  : nullptr;
230 
231  col_list_ptr_ptr->setName(col_list_name + ".ptrs");
232  col_list_length_ptr->setName(col_list_name + ".length");
233  col_list_size_ptr->setName(col_list_name + ".size");
234  if (is_text_encoding_dict_type) {
235  col_str_dict_ptr_ptr->setName(col_list_name + ".string_dict_proxies");
236  }
237 
238  CHECK(length >= 0);
239  auto const_length = llvm::ConstantInt::get(llvm::Type::getInt64Ty(ctx), length, true);
240 
241  if (data_ptrs != nullptr) {
242  if (data_ptrs->getType() == data_ptrs_llvm_type->getPointerElementType()) {
243  ir_builder.CreateStore(data_ptrs, col_list_ptr_ptr);
244  } else {
245  auto tmp = ir_builder.CreateBitCast(data_ptrs, data_ptrs_llvm_type);
246  ir_builder.CreateStore(tmp, col_list_ptr_ptr);
247  }
248  } else {
249  ir_builder.CreateStore(llvm::Constant::getNullValue(data_ptrs_llvm_type),
250  col_list_ptr_ptr);
251  }
252 
253  ir_builder.CreateStore(const_length, col_list_length_ptr);
254 
255  if (data_size != nullptr) {
256  auto data_size_type = data_size->getType();
257  llvm::Value* size_val = nullptr;
258  if (data_size_type->isPointerTy()) {
259  CHECK(data_size_type->getPointerElementType()->isIntegerTy(64));
260  size_val =
261  ir_builder.CreateLoad(data_size->getType()->getPointerElementType(), data_size);
262  } else {
263  CHECK(data_size_type->isIntegerTy(64));
264  size_val = data_size;
265  }
266  ir_builder.CreateStore(size_val, col_list_size_ptr);
267  } else {
268  auto const_minus1 = llvm::ConstantInt::get(llvm::Type::getInt64Ty(ctx), -1, true);
269  ir_builder.CreateStore(const_minus1, col_list_size_ptr);
270  }
271 
272  if (is_text_encoding_dict_type) {
273  if (data_str_dict_proxy_ptrs != nullptr) {
274  auto data_str_dict_proxies_type = data_str_dict_proxy_ptrs->getType();
275  CHECK(data_str_dict_proxies_type->getPointerElementType()->isIntegerTy(8));
276  ir_builder.CreateStore(data_str_dict_proxy_ptrs, col_str_dict_ptr_ptr);
277  } else {
278  ir_builder.CreateStore(llvm::Constant::getNullValue(data_ptrs_llvm_type),
279  col_list_ptr_ptr);
280  }
281  }
282 
283  auto col_list_ptr = ir_builder.CreatePointerCast(
284  col_list_ptr_ptr, llvm::PointerType::get(llvm::Type::getInt8Ty(ctx), 0));
285  col_list_ptr->setName(col_list_name + "_ptrs");
286  return col_list_ptr;
287 }
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:337
#define CHECK(condition)
Definition: Logger.h:223
bool is_string() const
Definition: sqltypes.h:510

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void anonymous_namespace{TableFunctionCompilationContext.cpp}::cast_column ( llvm::Value *  col_base_ptr,
llvm::Function *  func,
SQLTypeInfo orig_ti,
SQLTypeInfo dest_ti,
std::string  index,
llvm::IRBuilder<> &  ir_builder,
llvm::LLVMContext &  ctx,
CodeGenerator codeGenerator 
)

Definition at line 325 of file TableFunctionCompilationContext.cpp.

References cast_value(), and get_llvm_type_from_sql_column_type().

Referenced by TableFunctionCompilationContext::generateCastsForInputTypes().

332  {
333  /*
334  Generates code to cast a Column instance from a given origin
335  SQLType to a new destinaton SQLType. To do so, it generates a
336  loop with the following overall structure:
337 
338  --------------
339  | pre_header |
340  | i = 0 |
341  --------------
342  |
343  v
344  ---------------- ----------------
345  | cond | | body |
346  | i < col.size | (True) -> | cast(col[i]) |
347  ---------------- | i++ |
348  (False) ^ ----------------
349  | \____________________/
350  |
351  v
352  ---------------
353  | end |
354  ---------------
355 
356  The correctness of the cast as well as error handling/early
357  exiting in case of cast failures are left to the CodeGenerator
358  which generates the code for the cast operation itself.
359  */
360 
361  llvm::BasicBlock* for_pre =
362  llvm::BasicBlock::Create(ctx, "for_pre_cast." + index, func);
363  llvm::BasicBlock* for_cond =
364  llvm::BasicBlock::Create(ctx, "for_cond_cast." + index, func);
365  llvm::BasicBlock* for_body =
366  llvm::BasicBlock::Create(ctx, "for_body_cast." + index, func);
367  llvm::BasicBlock* for_end =
368  llvm::BasicBlock::Create(ctx, "for_end_cast." + index, func);
369  ir_builder.CreateBr(for_pre);
370 
371  // pre-header: load column ptr and size
372  ir_builder.SetInsertPoint(for_pre);
373  llvm::Type* data_type = get_llvm_type_from_sql_column_type(orig_ti, ctx);
374  llvm::StructType* col_struct_type =
375  llvm::StructType::get(ctx, {data_type, ir_builder.getInt64Ty()});
376  llvm::Value* struct_cast = ir_builder.CreateBitCast(
377  col_base_ptr, col_struct_type->getPointerTo(), "col_struct." + index);
378  llvm::Value* gep_ptr = ir_builder.CreateStructGEP(
379  col_struct_type, struct_cast, 0, "col_ptr_addr." + index);
380  llvm::Value* col_ptr = ir_builder.CreateLoad(data_type, gep_ptr, "col_ptr." + index);
381  llvm::Value* gep_sz =
382  ir_builder.CreateStructGEP(col_struct_type, struct_cast, 1, "col_sz_addr." + index);
383  llvm::Value* col_sz =
384  ir_builder.CreateLoad(ir_builder.getInt64Ty(), gep_sz, "col_sz." + index);
385  ir_builder.CreateBr(for_cond);
386 
387  // condition: check induction variable against loop predicate
388  ir_builder.SetInsertPoint(for_cond);
389  llvm::PHINode* for_ind_var =
390  ir_builder.CreatePHI(ir_builder.getInt64Ty(), 2, "for_ind_var." + index);
391  for_ind_var->addIncoming(ir_builder.getInt64(0), for_pre);
392  llvm::Value* for_pred =
393  ir_builder.CreateICmpSLT(for_ind_var, col_sz, "for_pred." + index);
394  ir_builder.CreateCondBr(for_pred, for_body, for_end);
395 
396  // body: perform value cast, increment induction variable
397  ir_builder.SetInsertPoint(for_body);
398  ;
399  llvm::Value* val_gep = ir_builder.CreateInBoundsGEP(
400  ir_builder.getInt64Ty(), col_ptr, for_ind_var, "val_gep." + index);
401  llvm::Value* val_load =
402  ir_builder.CreateLoad(ir_builder.getInt64Ty(), val_gep, "val_load." + index);
403  llvm::Value* cast_result = cast_value(val_load, orig_ti, dest_ti, false, codeGenerator);
404  cast_result->setName("cast_result." + index);
405  ir_builder.CreateStore(cast_result, val_gep);
406  llvm::Value* for_inc =
407  ir_builder.CreateAdd(for_ind_var, ir_builder.getInt64(1), "for_inc." + index);
408  ir_builder.CreateBr(for_cond);
409  // the cast codegening may have generated extra blocks, so for_body does not necessarily
410  // jump to for_cond directly
411  llvm::Instruction* inc_as_inst = llvm::cast<llvm::Instruction>(for_inc);
412  for_ind_var->addIncoming(for_inc, inc_as_inst->getParent());
413  ir_builder.SetInsertPoint(for_end);
414 }
llvm::Type * get_llvm_type_from_sql_column_type(const SQLTypeInfo elem_ti, llvm::LLVMContext &ctx)
llvm::Value * cast_value(llvm::Value *value, SQLTypeInfo &orig_ti, SQLTypeInfo &dest_ti, bool nullable, CodeGenerator &codeGenerator)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

llvm::Value* anonymous_namespace{TableFunctionCompilationContext.cpp}::cast_value ( llvm::Value *  value,
SQLTypeInfo orig_ti,
SQLTypeInfo dest_ti,
bool  nullable,
CodeGenerator codeGenerator 
)

Definition at line 307 of file TableFunctionCompilationContext.cpp.

References CodeGenerator::codegenCastBetweenTimestamps(), SQLTypeInfo::get_notnull(), SQLTypeInfo::get_type_name(), and SQLTypeInfo::is_timestamp().

Referenced by cast_column().

311  {
312  /*
313  Codegens a cast of a value from a given origin type to a given destination type, if such
314  implementation is available. Errors for unsupported casts.
315  */
316  if (orig_ti.is_timestamp() && dest_ti.is_timestamp()) {
317  return codeGenerator.codegenCastBetweenTimestamps(
318  value, orig_ti, dest_ti, !dest_ti.get_notnull());
319  } else {
320  throw std::runtime_error("Unsupported cast from " + orig_ti.get_type_name() + " to " +
321  dest_ti.get_type_name() + " during UDTF code generation.");
322  }
323 }
bool is_timestamp() const
Definition: sqltypes.h:895
std::string get_type_name() const
Definition: sqltypes.h:443
llvm::Value * codegenCastBetweenTimestamps(llvm::Value *ts_lv, const SQLTypeInfo &operand_dimen, const SQLTypeInfo &target_dimen, const bool nullable)
Definition: CastIR.cpp:170
HOST DEVICE bool get_notnull() const
Definition: sqltypes.h:336

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static bool anonymous_namespace{TableFunctionCompilationContext.cpp}::columnTypeRequiresCasting ( const SQLTypeInfo ti)
static

Definition at line 289 of file TableFunctionCompilationContext.cpp.

References SQLTypeInfo::get_precision(), SQLTypeInfo::get_subtype(), SQLTypeInfo::is_column(), and kTIMESTAMP.

Referenced by TableFunctionCompilationContext::generateEntryPoint().

289  {
290  /*
291  Returns whether a column requires casting before table function execution based on its
292  underlying SQL type
293  */
294 
295  if (!ti.is_column()) {
296  return false;
297  }
298 
299  // TIMESTAMP columns should always have nanosecond precision
300  if (ti.get_subtype() == kTIMESTAMP && ti.get_precision() != 9) {
301  return true;
302  }
303 
304  return false;
305 }
HOST DEVICE SQLTypes get_subtype() const
Definition: sqltypes.h:330
int get_precision() const
Definition: sqltypes.h:332
bool is_column() const
Definition: sqltypes.h:523

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::string anonymous_namespace{TableFunctionCompilationContext.cpp}::exprsKey ( const std::vector< Analyzer::Expr * > &  exprs)

Definition at line 416 of file TableFunctionCompilationContext.cpp.

References run_benchmark_import::result.

Referenced by TableFunctionCompilationContext::compile().

416  {
417  std::string result;
418  for (const auto& expr : exprs) {
419  const auto& ti = expr->get_type_info();
420  result += ti.to_string() + ", ";
421  }
422  return result;
423 }

+ Here is the caller graph for this function:

llvm::Function* anonymous_namespace{TableFunctionCompilationContext.cpp}::generate_entry_point ( const CgenState cgen_state)

Definition at line 30 of file TableFunctionCompilationContext.cpp.

References CgenState::context_, get_int_type(), and CgenState::module_.

Referenced by TableFunctionCompilationContext::compile().

30  {
31  auto& ctx = cgen_state->context_;
32  const auto pi8_type = llvm::PointerType::get(get_int_type(8, ctx), 0);
33  const auto ppi8_type = llvm::PointerType::get(pi8_type, 0);
34  const auto pi64_type = llvm::PointerType::get(get_int_type(64, ctx), 0);
35  const auto ppi64_type = llvm::PointerType::get(pi64_type, 0);
36  const auto i32_type = get_int_type(32, ctx);
37 
38  const auto func_type = llvm::FunctionType::get(
39  i32_type,
40  {pi8_type, ppi8_type, pi64_type, ppi8_type, ppi64_type, ppi8_type, pi64_type},
41  false);
42 
43  auto func = llvm::Function::Create(func_type,
44  llvm::Function::ExternalLinkage,
45  "call_table_function",
46  cgen_state->module_);
47  auto arg_it = func->arg_begin();
48  const auto mgr_arg = &*arg_it;
49  mgr_arg->setName("mgr_ptr");
50  const auto input_cols_arg = &*(++arg_it);
51  input_cols_arg->setName("input_col_buffers");
52  const auto input_row_counts = &*(++arg_it);
53  input_row_counts->setName("input_row_counts");
54  const auto input_str_dict_proxies = &*(++arg_it);
55  input_str_dict_proxies->setName("input_str_dict_proxies");
56  const auto output_buffers = &*(++arg_it);
57  output_buffers->setName("output_buffers");
58  const auto output_str_dict_proxies = &*(++arg_it);
59  output_str_dict_proxies->setName("output_str_dict_proxies");
60  const auto output_row_count = &*(++arg_it);
61  output_row_count->setName("output_row_count");
62  return func;
63 }
llvm::Type * get_int_type(const int width, llvm::LLVMContext &context)
llvm::Module * module_
Definition: CgenState.h:350
llvm::LLVMContext & context_
Definition: CgenState.h:359

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

llvm::Type* anonymous_namespace{TableFunctionCompilationContext.cpp}::get_llvm_type_from_sql_column_type ( const SQLTypeInfo  elem_ti,
llvm::LLVMContext &  ctx 
)
inline

Definition at line 65 of file TableFunctionCompilationContext.cpp.

References CHECK, logger::FATAL, SQLTypeInfo::get_compression(), get_fp_ptr_type(), get_int_ptr_type(), SQLTypeInfo::get_size(), SQLTypeInfo::is_boolean(), SQLTypeInfo::is_bytes(), SQLTypeInfo::is_fp(), SQLTypeInfo::is_integer(), SQLTypeInfo::is_string(), SQLTypeInfo::is_timestamp(), kENCODING_DICT, LOG, and toString().

Referenced by alloc_column(), and cast_column().

66  {
67  if (elem_ti.is_fp()) {
68  return get_fp_ptr_type(elem_ti.get_size() * 8, ctx);
69  } else if (elem_ti.is_boolean()) {
70  return get_int_ptr_type(8, ctx);
71  } else if (elem_ti.is_integer()) {
72  return get_int_ptr_type(elem_ti.get_size() * 8, ctx);
73  } else if (elem_ti.is_string()) {
74  if (elem_ti.get_compression() == kENCODING_DICT) {
75  return get_int_ptr_type(elem_ti.get_size() * 8, ctx);
76  }
77  CHECK(elem_ti.is_bytes()); // None encoded string
78  return get_int_ptr_type(8, ctx);
79  } else if (elem_ti.is_timestamp()) {
80  return get_int_ptr_type(elem_ti.get_size() * 8, ctx);
81  }
82  LOG(FATAL) << "get_llvm_type_from_sql_column_type: not implemented for "
83  << ::toString(elem_ti);
84  return nullptr;
85 }
llvm::Type * get_fp_ptr_type(const int width, llvm::LLVMContext &context)
HOST DEVICE int get_size() const
Definition: sqltypes.h:339
bool is_timestamp() const
Definition: sqltypes.h:895
#define LOG(tag)
Definition: Logger.h:217
bool is_fp() const
Definition: sqltypes.h:514
bool is_integer() const
Definition: sqltypes.h:512
bool is_boolean() const
Definition: sqltypes.h:517
std::string toString(const Executor::ExtModuleKinds &kind)
Definition: Execute.h:1453
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:337
bool is_bytes() const
Definition: sqltypes.h:525
#define CHECK(condition)
Definition: Logger.h:223
bool is_string() const
Definition: sqltypes.h:510
llvm::Type * get_int_ptr_type(const int width, llvm::LLVMContext &context)

+ Here is the call graph for this function:

+ Here is the caller graph for this function: