当前位置: 首页>>代码示例>>C++>>正文


C++ CodeGen::Int32Type方法代码示例

本文整理汇总了C++中CodeGen::Int32Type方法的典型用法代码示例。如果您正苦于以下问题:C++ CodeGen::Int32Type方法的具体用法?C++ CodeGen::Int32Type怎么用?C++ CodeGen::Int32Type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CodeGen的用法示例。


在下文中一共展示了CodeGen::Int32Type方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: VectorizedIterate

// Iterate over the tuples in the sorter in batches/vectors of the given size
void Sorter::VectorizedIterate(
    CodeGen &codegen, llvm::Value *sorter_ptr, uint32_t vector_size,
    uint64_t offset, Sorter::VectorizedIterateCallback &callback) const {
  llvm::Value *start_pos = codegen.Load(SorterProxy::tuples_start, sorter_ptr);
  llvm::Value *num_tuples = NumTuples(codegen, sorter_ptr);
  num_tuples = codegen->CreateTrunc(num_tuples, codegen.Int32Type());

  if (offset != 0) {
    start_pos = codegen->CreateConstInBoundsGEP1_32(codegen.CharPtrType(),
                                                    start_pos, offset);
    num_tuples = codegen->CreateSub(num_tuples, codegen.Const32(offset));
  }

  lang::VectorizedLoop loop(codegen, num_tuples, vector_size, {});
  {
    // Current loop range
    auto curr_range = loop.GetCurrentRange();

    // Provide an accessor into the sorted space
    SorterAccess sorter_access(*this, start_pos);

    // Issue the callback
    callback.ProcessEntries(codegen, curr_range.start, curr_range.end,
                            sorter_access);

    // That's it
    loop.LoopEnd(codegen, {});
  }
}
开发者ID:cmu-db,项目名称:peloton,代码行数:30,代码来源:sorter.cpp

示例2: GetStartPosition

llvm::Value *Sorter::GetNumberOfStoredTuples(CodeGen &codegen,
                                             llvm::Value *sorter_ptr) const {
  // TODO: util::Sorter has a function to handle this ...
  llvm::Value *start_pos = GetStartPosition(codegen, sorter_ptr);
  llvm::Value *end_pos = GetEndPosition(codegen, sorter_ptr);
  llvm::Value *tuple_size =
      codegen->CreateZExt(GetTupleSize(codegen), codegen.Int64Type());

  llvm::Value *diff_bytes = codegen->CreatePtrDiff(end_pos, start_pos);
  llvm::Value *num_tuples = codegen->CreateUDiv(diff_bytes, tuple_size);
  return codegen->CreateTruncOrBitCast(num_tuples, codegen.Int32Type());
}
开发者ID:wy4515,项目名称:peloton,代码行数:12,代码来源:sorter.cpp

示例3:

void RowBatch::Row::SetValidity(CodeGen &codegen, llvm::Value *valid) {
  if (valid->getType() != codegen.BoolType()) {
    std::string error_msg;
    llvm::raw_string_ostream rso{error_msg};
    rso << "Validity of row must be a boolean value. Received type: "
        << valid->getType();
    throw Exception{error_msg};
  }

  if (output_tracker_ == nullptr) {
    throw Exception{"You didn't provide an output tracker for the row!"};
  }

  // Append this row to the output
  llvm::Value *delta = codegen->CreateZExt(valid, codegen.Int32Type());
  output_tracker_->AppendRowToOutput(codegen, *this, delta);
}
开发者ID:apavlo,项目名称:peloton,代码行数:17,代码来源:row_batch.cpp

示例4: GetTypeForMaterialization

void Varchar::GetTypeForMaterialization(CodeGen &codegen, llvm::Type *&val_type,
                                        llvm::Type *&len_type) const {
  val_type = codegen.CharPtrType();
  len_type = codegen.Int32Type();
}
开发者ID:foche,项目名称:peloton,代码行数:5,代码来源:varchar_type.cpp

示例5: GetTypeForMaterialization

void Date::GetTypeForMaterialization(CodeGen &codegen, llvm::Type *&val_type,
                                     llvm::Type *&len_type) const {
  val_type = codegen.Int32Type();
  len_type = nullptr;
}
开发者ID:apavlo,项目名称:peloton,代码行数:5,代码来源:date_type.cpp


注:本文中的CodeGen::Int32Type方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。