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

Method CodegenHelper

be/src/runtime/fragment-state.cc:154–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152}
153
154Status 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
188FragmentState::FragmentState(QueryState* query_state, const TPlanFragment& fragment,
189 const PlanFragmentCtxPB& fragment_ctx)

Callers

nothing calls this directly

Calls 9

OKFunction · 0.85
main_thread_timerMethod · 0.80
ir_generation_timerMethod · 0.80
total_time_counterMethod · 0.80
llvm_thread_countersMethod · 0.80
FinalizeModuleAsyncMethod · 0.80
runtime_profileMethod · 0.45
CodegenMethod · 0.45
FinalizeModuleMethod · 0.45

Tested by

no test coverage detected