aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/core/peephole_opt/yql_opt_peephole_physical.h
blob: bd7c7d8113700c423e2a59e929dec0bde5f06a3c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#pragma once

#include <yql/essentials/core/yql_data_provider.h>
#include <yql/essentials/core/yql_type_annotation.h>

namespace NYql {

struct IPipelineConfigurator;

struct TPeepholeSettings {
    const IPipelineConfigurator* CommonConfig = nullptr;
    const IPipelineConfigurator* FinalConfig = nullptr;
    bool WithFinalStageRules = true;
    bool WithNonDeterministicRules = true;
};

IGraphTransformer::TStatus PeepHoleOptimizeNode(const TExprNode::TPtr& input, TExprNode::TPtr& output,
    TExprContext& ctx, TTypeAnnotationContext& types, IGraphTransformer* typeAnnotator,
    bool& hasNonDeterministicFunctions, const TPeepholeSettings& peepholeSettings = {});

THolder<IGraphTransformer> MakePeepholeOptimization(TTypeAnnotationContextPtr typeAnnotationContext, const IPipelineConfigurator* config = nullptr);

}