For sample IR, see 'FillCodegendComputeFnConstantFalse' and 'FillCodegendComputeFnNonConstant'. If there is at least one non-nullable tuple, we codegen a function that returns a constant false BooleanValue.
| 68 | /// If there is at least one non-nullable tuple, we codegen a function that returns a |
| 69 | /// constant false BooleanValue. |
| 70 | Status TupleIsNullPredicate::GetCodegendComputeFnImpl(LlvmCodeGen* codegen, |
| 71 | llvm::Function** fn) { |
| 72 | DCHECK_EQ(0, GetNumChildren()); |
| 73 | |
| 74 | llvm::Value* args[2]; |
| 75 | llvm::Function* function = CreateIrFunctionPrototype( |
| 76 | "TupleIsNullPredicate", codegen, &args); |
| 77 | |
| 78 | if (tuple_idxs_.size() < tuple_ids_.size()) { |
| 79 | FillCodegendComputeFnConstantFalse(codegen, function); |
| 80 | } else { |
| 81 | FillCodegendComputeFnNonConstant(codegen, function, args); |
| 82 | } |
| 83 | |
| 84 | *fn = codegen->FinalizeFunction(function); |
| 85 | if (UNLIKELY(*fn == nullptr)) { |
| 86 | return Status(TErrorCode::IR_VERIFY_FAILED, "TupleIsNullPredicate"); |
| 87 | } |
| 88 | return Status::OK(); |
| 89 | } |
| 90 | |
| 91 | /// Sample IR: |
| 92 | /// define i16 @TupleIsNullPredicate(%"class.impala::ScalarExprEvaluator"* %eval, |
nothing calls this directly
no test coverage detected