MCPcopy Create free account
hub / github.com/apache/arrow / VisitInExpression

Method VisitInExpression

cpp/src/gandiva/llvm_generator.cc:1064–1108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1062
1063template <typename Type>
1064void LLVMGenerator::Visitor::VisitInExpression(const InExprDexBase<Type>& dex) {
1065 ADD_VISITOR_TRACE("visit In Expression");
1066 LLVMTypes* types = generator_->types();
1067 std::vector<llvm::Value*> params;
1068
1069 const InExprDex<Type>& dex_instance = dynamic_cast<const InExprDex<Type>&>(dex);
1070
1071 /* add the holder at the beginning */
1072
1073 // Switch to the entry block and load the holder pointer
1074 auto builder = ir_builder();
1075 llvm::BasicBlock* saved_block = builder->GetInsertBlock();
1076 builder->SetInsertPoint(entry_block_);
1077
1078 llvm::Value* in_holder = generator_->LoadVectorAtIndex(
1079 arg_holder_ptrs_, types->i64_type(), dex_instance.get_holder_idx(), "in_holder");
1080
1081 builder->SetInsertPoint(saved_block);
1082 params.push_back(in_holder);
1083
1084 /* eval expr result */
1085 for (auto& pair : dex.args()) {
1086 DexPtr value_expr = pair->value_expr();
1087 value_expr->Accept(*this);
1088 LValue& result_ref = *result();
1089 params.push_back(result_ref.data());
1090
1091 /* length if the result is a string */
1092 if (result_ref.length() != nullptr) {
1093 params.push_back(result_ref.length());
1094 }
1095
1096 /* push the validity of eval expr result */
1097 llvm::Value* validity_expr = BuildCombinedValidity(pair->validity_exprs());
1098 params.push_back(validity_expr);
1099 }
1100
1101 llvm::Type* ret_type = types->IRType(arrow::Type::type::BOOL);
1102
1103 llvm::Value* value;
1104
1105 value = generator_->AddFunctionCall(dex.runtime_function(), ret_type, params);
1106
1107 result_.reset(new LValue(value));
1108}
1109
1110template <>
1111void LLVMGenerator::Visitor::VisitInExpression<gandiva::DecimalScalar128>(

Callers

nothing calls this directly

Calls 11

resultFunction · 0.85
typesMethod · 0.80
LoadVectorAtIndexMethod · 0.80
push_backMethod · 0.80
AddFunctionCallMethod · 0.80
ir_builderFunction · 0.70
get_holder_idxMethod · 0.45
AcceptMethod · 0.45
dataMethod · 0.45
lengthMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected