@@ -21,6 +21,7 @@ import {
21
21
lower ,
22
22
mergeConsecutiveBlocks ,
23
23
mergeOverlappingReactiveScopesHIR ,
24
+ printFunction ,
24
25
pruneUnusedLabelsHIR ,
25
26
} from '../HIR' ;
26
27
import {
@@ -101,6 +102,7 @@ import {propagatePhiTypes} from '../TypeInference/PropagatePhiTypes';
101
102
import { lowerContextAccess } from '../Optimization/LowerContextAccess' ;
102
103
import { validateNoSetStateInPassiveEffects } from '../Validation/ValidateNoSetStateInPassiveEffects' ;
103
104
import { validateNoJSXInTryStatement } from '../Validation/ValidateNoJSXInTryStatement' ;
105
+ import { propagateScopeDependenciesHIR } from '../HIR/PropagateScopeDependenciesHIR' ;
104
106
105
107
export type CompilerPipelineValue =
106
108
| { kind : 'ast' ; name : string ; value : CodegenFunction }
@@ -341,6 +343,14 @@ function* runWithEnvironment(
341
343
} ) ;
342
344
assertTerminalSuccessorsExist ( hir ) ;
343
345
assertTerminalPredsExist ( hir ) ;
346
+ if ( env . config . enablePropagateDepsInHIR ) {
347
+ propagateScopeDependenciesHIR ( hir ) ;
348
+ yield log ( {
349
+ kind : 'hir' ,
350
+ name : 'PropagateScopeDependenciesHIR' ,
351
+ value : hir ,
352
+ } ) ;
353
+ }
344
354
345
355
const reactiveFunction = buildReactiveFunction ( hir ) ;
346
356
yield log ( {
@@ -359,12 +369,14 @@ function* runWithEnvironment(
359
369
} ) ;
360
370
assertScopeInstructionsWithinScopes ( reactiveFunction ) ;
361
371
362
- propagateScopeDependencies ( reactiveFunction ) ;
363
- yield log ( {
364
- kind : 'reactive' ,
365
- name : 'PropagateScopeDependencies' ,
366
- value : reactiveFunction ,
367
- } ) ;
372
+ if ( ! env . config . enablePropagateDepsInHIR ) {
373
+ propagateScopeDependencies ( reactiveFunction ) ;
374
+ yield log ( {
375
+ kind : 'reactive' ,
376
+ name : 'PropagateScopeDependencies' ,
377
+ value : reactiveFunction ,
378
+ } ) ;
379
+ }
368
380
369
381
pruneNonEscapingScopes ( reactiveFunction ) ;
370
382
yield log ( {
0 commit comments