| 152 | } |
| 153 | |
| 154 | Status FragmentState::CodegenHelper(RuntimeProfile::EventSequence* event_sequence) { |
| 155 | DCHECK(plan_tree_ != nullptr); |
| 156 | DCHECK(sink_config_ != nullptr); |
| 157 | DCHECK(ShouldCodegen()); |
| 158 | RETURN_IF_ERROR(CreateCodegen()); |
| 159 | |
| 160 | SCOPED_TIMER(codegen()->main_thread_timer()); |
| 161 | { |
| 162 | SCOPED_TIMER2(codegen()->ir_generation_timer(), |
| 163 | codegen()->runtime_profile()->total_time_counter()); |
| 164 | SCOPED_THREAD_COUNTER_MEASUREMENT(codegen()->llvm_thread_counters()); |
| 165 | plan_tree_->Codegen(this); |
| 166 | sink_config_->Codegen(this); |
| 167 | // It shouldn't be fatal to fail codegen. However, until IMPALA-4233 is fixed, |
| 168 | // ScalarFnCall has no fall back to interpretation when codegen fails so propagates |
| 169 | // the error status for now. Now that IMPALA-4233 is fixed, revisit this comment. |
| 170 | RETURN_IF_ERROR(CodegenScalarExprs()); |
| 171 | } |
| 172 | |
| 173 | LlvmCodeGen* llvm_codegen = codegen(); |
| 174 | DCHECK(llvm_codegen != nullptr); |
| 175 | |
| 176 | // In case we need codegen, we cannot use asynchronous codegen because we cannot |
| 177 | // interpret the query until codegen has run. |
| 178 | const bool async_enabled = query_options().async_codegen; |
| 179 | if (async_enabled && is_interpretable()) { |
| 180 | RETURN_IF_ERROR(llvm_codegen->FinalizeModuleAsync(event_sequence)); |
| 181 | } else { |
| 182 | RETURN_IF_ERROR(llvm_codegen->FinalizeModule()); |
| 183 | } |
| 184 | |
| 185 | return Status::OK(); |
| 186 | } |
| 187 | |
| 188 | FragmentState::FragmentState(QueryState* query_state, const TPlanFragment& fragment, |
| 189 | const PlanFragmentCtxPB& fragment_ctx) |
nothing calls this directly
no test coverage detected