diff options
author | a-romanov <Anton.Romanov@ydb.tech> | 2023-10-27 15:34:11 +0300 |
---|---|---|
committer | a-romanov <Anton.Romanov@ydb.tech> | 2023-10-27 16:59:07 +0300 |
commit | 61fa043381474a30db08beeb087f55ea26e6a9cf (patch) | |
tree | 9b9dc6860b158c3244f1d131140e6d436e8e5d58 | |
parent | 2ce234859f5c95d13204a1155674aef3b9e31d18 (diff) | |
download | ydb-61fa043381474a30db08beeb087f55ea26e6a9cf.tar.gz |
YQL-15891 Remove fallback if no codegen.
-rw-r--r-- | ydb/library/yql/minikql/computation/mkql_computation_node_graph.cpp | 117 |
1 files changed, 54 insertions, 63 deletions
diff --git a/ydb/library/yql/minikql/computation/mkql_computation_node_graph.cpp b/ydb/library/yql/minikql/computation/mkql_computation_node_graph.cpp index 01e391a98c..cc4be0bcce 100644 --- a/ydb/library/yql/minikql/computation/mkql_computation_node_graph.cpp +++ b/ydb/library/yql/minikql/computation/mkql_computation_node_graph.cpp @@ -819,91 +819,82 @@ public: TStatTimer timerFull(CodeGen_FullTime); timerFull.Acquire(); - bool hasCode = false; { TStatTimer timerGen(CodeGen_GenerateTime); timerGen.Acquire(); for (auto it = nodes.crbegin(); nodes.crend() != it; ++it) { if (const auto codegen = dynamic_cast<ICodegeneratorRootNode*>(it->Get())) { - try { - codegen->GenerateFunctions(*Codegen); - hasCode = true; - } catch (const TNoCodegen&) { - hasCode = false; - break; - } + codegen->GenerateFunctions(*Codegen); } } timerGen.Release(); timerGen.Report(stats); } - if (hasCode) { - if (optLLVM.Contains("--dump-generated")) { - Cerr << "############### Begin generated module ###############" << Endl; - Codegen->GetModule().print(llvm::errs(), nullptr); - Cerr << "################ End generated module ################" << Endl; - } + if (optLLVM.Contains("--dump-generated")) { + Cerr << "############### Begin generated module ###############" << Endl; + Codegen->GetModule().print(llvm::errs(), nullptr); + Cerr << "################ End generated module ################" << Endl; + } - TStatTimer timerComp(CodeGen_CompileTime); - timerComp.Acquire(); - - NYql::NCodegen::TCodegenStats codegenStats; - Codegen->GetStats(codegenStats); - MKQL_ADD_STAT(stats, CodeGen_TotalFunctions, codegenStats.TotalFunctions); - MKQL_ADD_STAT(stats, CodeGen_TotalInstructions, codegenStats.TotalInstructions); - MKQL_SET_MAX_STAT(stats, CodeGen_MaxFunctionInstructions, codegenStats.MaxFunctionInstructions); - if (optLLVM.Contains("--dump-stats")) { - Cerr << "TotalFunctions: " << codegenStats.TotalFunctions << Endl; - Cerr << "TotalInstructions: " << codegenStats.TotalInstructions << Endl; - Cerr << "MaxFunctionInstructions: " << codegenStats.MaxFunctionInstructions << Endl; - } + TStatTimer timerComp(CodeGen_CompileTime); + timerComp.Acquire(); - if (optLLVM.Contains("--dump-perf-map")) { - Codegen->TogglePerfJITEventListener(); - } + NYql::NCodegen::TCodegenStats codegenStats; + Codegen->GetStats(codegenStats); + MKQL_ADD_STAT(stats, CodeGen_TotalFunctions, codegenStats.TotalFunctions); + MKQL_ADD_STAT(stats, CodeGen_TotalInstructions, codegenStats.TotalInstructions); + MKQL_SET_MAX_STAT(stats, CodeGen_MaxFunctionInstructions, codegenStats.MaxFunctionInstructions); + if (optLLVM.Contains("--dump-stats")) { + Cerr << "TotalFunctions: " << codegenStats.TotalFunctions << Endl; + Cerr << "TotalInstructions: " << codegenStats.TotalInstructions << Endl; + Cerr << "MaxFunctionInstructions: " << codegenStats.MaxFunctionInstructions << Endl; + } - if (codegenStats.TotalFunctions >= TotalFunctionsLimit || - codegenStats.TotalInstructions >= TotalInstructionsLimit || - codegenStats.MaxFunctionInstructions >= MaxFunctionInstructionsLimit) { - Codegen.reset(); - } else { - Codegen->Verify(); - Codegen->Compile(GetCompileOptions(optLLVM), &CompileStats); + if (optLLVM.Contains("--dump-perf-map")) { + Codegen->TogglePerfJITEventListener(); + } - MKQL_ADD_STAT(stats, CodeGen_FunctionPassTime, CompileStats.FunctionPassTime); - MKQL_ADD_STAT(stats, CodeGen_ModulePassTime, CompileStats.ModulePassTime); - MKQL_ADD_STAT(stats, CodeGen_FinalizeTime, CompileStats.FinalizeTime); - } + if (codegenStats.TotalFunctions >= TotalFunctionsLimit || + codegenStats.TotalInstructions >= TotalInstructionsLimit || + codegenStats.MaxFunctionInstructions >= MaxFunctionInstructionsLimit) { + Codegen.reset(); + } else { + Codegen->Verify(); + Codegen->Compile(GetCompileOptions(optLLVM), &CompileStats); - timerComp.Release(); - timerComp.Report(stats); + MKQL_ADD_STAT(stats, CodeGen_FunctionPassTime, CompileStats.FunctionPassTime); + MKQL_ADD_STAT(stats, CodeGen_ModulePassTime, CompileStats.ModulePassTime); + MKQL_ADD_STAT(stats, CodeGen_FinalizeTime, CompileStats.FinalizeTime); + } - if (Codegen) { - if (optLLVM.Contains("--dump-compiled")) { - Cerr << "############### Begin compiled module ###############" << Endl; - Codegen->GetModule().print(llvm::errs(), nullptr); - Cerr << "################ End compiled module ################" << Endl; - } + timerComp.Release(); + timerComp.Report(stats); - if (optLLVM.Contains("--asm-compiled")) { - Cerr << "############### Begin compiled asm ###############" << Endl; - Codegen->ShowGeneratedFunctions(&Cerr); - Cerr << "################ End compiled asm ################" << Endl; - } + if (Codegen) { + if (optLLVM.Contains("--dump-compiled")) { + Cerr << "############### Begin compiled module ###############" << Endl; + Codegen->GetModule().print(llvm::errs(), nullptr); + Cerr << "################ End compiled module ################" << Endl; + } - ui64 count = 0U; - for (const auto& node : nodes) { - if (const auto codegen = dynamic_cast<ICodegeneratorRootNode*>(node.Get())) { - codegen->FinalizeFunctions(*Codegen); - ++count; - } - } + if (optLLVM.Contains("--asm-compiled")) { + Cerr << "############### Begin compiled asm ###############" << Endl; + Codegen->ShowGeneratedFunctions(&Cerr); + Cerr << "################ End compiled asm ################" << Endl; + } - if (count) { - MKQL_ADD_STAT(stats, Mkql_CodegenFunctions, count); + ui64 count = 0U; + for (const auto& node : nodes) { + if (const auto codegen = dynamic_cast<ICodegeneratorRootNode*>(node.Get())) { + codegen->FinalizeFunctions(*Codegen); + ++count; } } + + if (count) { + MKQL_ADD_STAT(stats, Mkql_CodegenFunctions, count); + } } timerFull.Release(); |