Commit faa3f49
committed
[compiler] Migrate PruneNonEscapingScopes to HIR
Summary:
PruneNonEscapingScopes does a pretty powerful escape analysis, which we might want to apply for other purposes in our HIR passes. This ports this pass to HIR. For the most part, this implementation is identical to the ReactiveFunction version. It now handles phis instead of conditional ReactiveExpressions, which it does by treating all the phi operands as possibly aliasing the lvalue. This also requires that we iterate the aliasing analysis to a fixpoint, because the HIR has backedges which the ReactiveFunctions don't.
In our fixtures, this only changes one result, which appears to have become more accurate. I plan on testing this internally in a sync before landing.
ghstack-source-id: 63aad5c
Pull Request resolved: #318821 parent 6907aa2 commit faa3f49
File tree
3 files changed
+968
-16
lines changed- compiler/packages/babel-plugin-react-compiler/src
- Entrypoint
- HIR
- __tests__/fixtures/compiler
3 files changed
+968
-16
lines changedLines changed: 8 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | 62 | | |
64 | 63 | | |
65 | 64 | | |
| |||
98 | 97 | | |
99 | 98 | | |
100 | 99 | | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| |||
364 | 364 | | |
365 | 365 | | |
366 | 366 | | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
367 | 374 | | |
368 | 375 | | |
369 | 376 | | |
| |||
390 | 397 | | |
391 | 398 | | |
392 | 399 | | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | 400 | | |
401 | 401 | | |
402 | 402 | | |
| |||
0 commit comments