MCPcopy Create free account
hub / github.com/apache/impala / Compare

Method Compare

be/src/codegen/codegen-anyval.cc:729–744  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

727}
728
729llvm::Value* CodegenAnyVal::Compare(CodegenAnyVal* other, const char* name) {
730 DCHECK_EQ(type_, other->type_);
731 llvm::Value* v1 = SlotDescriptor::CodegenStoreNonNullAnyValToNewAlloca(*this);
732 llvm::Value* void_v1 = builder_->CreateBitCast(v1, codegen_->ptr_type());
733 llvm::Value* v2 = SlotDescriptor::CodegenStoreNonNullAnyValToNewAlloca(*other);
734 llvm::Value* void_v2 = builder_->CreateBitCast(v2, codegen_->ptr_type());
735 // Create a global constant of the values' ColumnType. It needs to be a constant
736 // for constant propagation and dead code elimination in 'compare_fn'.
737 llvm::Type* col_type = codegen_->GetStructType<ColumnType>();
738 llvm::Constant* type_ptr =
739 codegen_->ConstantToGVPtr(col_type, type_.ToIR(codegen_), "type");
740 llvm::Function* compare_fn =
741 codegen_->GetFunction(IRFunction::RAW_VALUE_COMPARE, false);
742 llvm::Value* args[] = {void_v1, void_v2, type_ptr};
743 return builder_->CreateCall(compare_fn, args, name);
744}
745
746void CodegenAnyVal::CodegenBranchIfNull(
747 LlvmBuilder* builder, llvm::BasicBlock* null_block) {

Callers

nothing calls this directly

Calls 5

ptr_typeMethod · 0.80
ConstantToGVPtrMethod · 0.80
CreateCallMethod · 0.80
ToIRMethod · 0.45
GetFunctionMethod · 0.45

Tested by

no test coverage detected