| 353 | } |
| 354 | |
| 355 | static bool isCompilableFunction(const ActionsDAG::Node & node, const std::unordered_set<const ActionsDAG::Node *> & lazy_executed_nodes) |
| 356 | { |
| 357 | if (node.type != ActionsDAG::ActionType::FUNCTION) |
| 358 | return false; |
| 359 | |
| 360 | const auto & function = *node.function_base; |
| 361 | |
| 362 | IFunction::ShortCircuitSettings settings; |
| 363 | if (function.isShortCircuit(settings, node.children.size())) |
| 364 | { |
| 365 | for (const auto & child : node.children) |
| 366 | { |
| 367 | const ActionsDAG::Node * child_no_alias = removeAliasIfNecessary(child); |
| 368 | |
| 369 | if (lazy_executed_nodes.contains(child_no_alias)) |
| 370 | return false; |
| 371 | } |
| 372 | } |
| 373 | |
| 374 | if (!canBeNativeType(*function.getResultType())) |
| 375 | { |
| 376 | return false; |
| 377 | } |
| 378 | |
| 379 | const auto & argument_types = function.getArgumentTypes(); |
| 380 | auto skip_arguments = function.getArgumentsThatDontParticipateInCompilation(argument_types); |
| 381 | for (size_t i = 0; i < argument_types.size(); ++i) |
| 382 | { |
| 383 | if (std::find(skip_arguments.begin(), skip_arguments.end(), i) != skip_arguments.end()) |
| 384 | continue; |
| 385 | |
| 386 | const auto & type = argument_types[i]; |
| 387 | if (!canBeNativeType(*type)) |
| 388 | { |
| 389 | return false; |
| 390 | } |
| 391 | } |
| 392 | |
| 393 | return function.isCompilable(); |
| 394 | } |
| 395 | |
| 396 | static CompileDAG getCompilableDAG( |
| 397 | const ActionsDAG::Node * root, |
no test coverage detected