@@ -243,13 +243,14 @@ struct TDqsPipelineConfigurator : public IPipelineConfigurator {
243
243
void AfterCreate (TTransformationPipeline*) const final {}
244
244
245
245
void AfterTypeAnnotation (TTransformationPipeline* pipeline) const final {
246
+ // First truncate graph by calculated precomputes
247
+ pipeline->Add (NDqs::CreateDqsReplacePrecomputesTransformer (*pipeline->GetTypeAnnotationContext (), State_->FunctionRegistry ), " ReplacePrecomputes" );
248
+
249
+ // Then apply provider specific transformers on truncated graph
246
250
std::for_each (UniqIntegrations_.cbegin (), UniqIntegrations_.cend (), [&](const auto dqInt) {
247
- for (auto & stage: dqInt->GetPeepholeTransforms (true , ProviderParams_)) {
248
- pipeline->Add (std::move (stage));
249
- }
251
+ dqInt->ConfigurePeepholePipeline (true , ProviderParams_, pipeline);
250
252
});
251
253
252
- pipeline->Add (NDqs::CreateDqsReplacePrecomputesTransformer (*pipeline->GetTypeAnnotationContext (), State_->FunctionRegistry ), " ReplacePrecomputes" );
253
254
if (State_->Settings ->UseBlockReader .Get ().GetOrElse (false )) {
254
255
pipeline->Add (NDqs::CreateDqsRewritePhyBlockReadOnDqIntegrationTransformer (*pipeline->GetTypeAnnotationContext ()), " ReplaceWideReadsWithBlock" );
255
256
}
@@ -274,9 +275,7 @@ struct TDqsPipelineConfigurator : public IPipelineConfigurator {
274
275
275
276
void AfterOptimize (TTransformationPipeline* pipeline) const final {
276
277
std::for_each (UniqIntegrations_.cbegin (), UniqIntegrations_.cend (), [&](const auto dqInt) {
277
- for (auto & stage: dqInt->GetPeepholeTransforms (false , ProviderParams_)) {
278
- pipeline->Add (std::move (stage));
279
- }
278
+ dqInt->ConfigurePeepholePipeline (false , ProviderParams_, pipeline);
280
279
});
281
280
}
282
281
0 commit comments