Stephen Adams
3a91bcb39e
[dart2js] SSA - pre-assign variable to reduce phi assignments
...
Introducing a partial redundancy with a variable with a longer
live-range can reduce the size of the emitted code.
Flute.complex (-O4): -0.377%
cm_shell (-O4): -0.029%
Change-Id: I0d03119b17f4b58d61f277bf8bb0e57d8e7c47c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360360
Reviewed-by: Mayank Patke <fishythefish@google.com >
Commit-Queue: Stephen Adams <sra@google.com >
2024-06-17 22:47:57 +00:00
Stephen Adams
4df361c3c3
Reapply "[dart2js] Replace phi with controlling condition"
...
This reverts commit aec3ec0244 .
- Corrected 'controlling condition' detection.
- Added test that is incorrectly compiled to infinite loop with incorrect controlling condition detection.
See https://github.com/dart-lang/sdk/issues/54115#issuecomment-1944285230 for an image of part of the CFG for `doWhileLoop` where the condition in B4 was previously mis-identified as controlling `phi(true,false)` at B12.
Issue: #54115
Change-Id: I0d2c2ff83b202071f6d7050d34de8ff25d05cb22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352443
Reviewed-by: Mayank Patke <fishythefish@google.com >
Commit-Queue: Stephen Adams <sra@google.com >
2024-02-15 01:02:39 +00:00
Mayank Patke
aec3ec0244
Revert "[dart2js] Replace phi with controlling condition"
...
This reverts commit 75b1973041 .
Reason for revert: Breaks g3 tests
Original change's description:
> [dart2js] Replace phi with controlling condition
>
> Rewrite `phi(true, false)` to the controlling condition.
>
> This patchset comparison shows the general effect: https://dart-review.googlesource.com/c/sdk/+/340065/2..3/pkg/compiler/test/codegen/data/phi_to_condition_test.dart
>
> This change is a partial remedy for http://dartbug.com/54115
>
> Issue: #54115
> Change-Id: Ibcc5d17f6c4c8ad9600840ec106f84edcd008e4a
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340065
> Reviewed-by: Nate Biggs <natebiggs@google.com >
> Commit-Queue: Stephen Adams <sra@google.com >
Issue: #54115
Change-Id: Id717ef469b09a5b07e43b3ffafc54bc6b409f0df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350006
Reviewed-by: Sigmund Cherem <sigmund@google.com >
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com >
Commit-Queue: Mayank Patke <fishythefish@google.com >
2024-02-03 00:56:15 +00:00
Stephen Adams
75b1973041
[dart2js] Replace phi with controlling condition
...
Rewrite `phi(true, false)` to the controlling condition.
This patchset comparison shows the general effect: https://dart-review.googlesource.com/c/sdk/+/340065/2..3/pkg/compiler/test/codegen/data/phi_to_condition_test.dart
This change is a partial remedy for http://dartbug.com/54115
Issue: #54115
Change-Id: Ibcc5d17f6c4c8ad9600840ec106f84edcd008e4a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340065
Reviewed-by: Nate Biggs <natebiggs@google.com >
Commit-Queue: Stephen Adams <sra@google.com >
2024-01-25 01:11:03 +00:00
Stephen Adams
9864cb2231
[dart2js] Recognize larger no-op regions
...
Recognize larger regions of no-op control flow. Ideally we would be able to remove these regions from the CFG. Until then, pattern matching larger regions leaves fewer ghost conditions in the generated code.
With pattern matching, we are seeing more examples where this is necessary.
Bug: #29475
Change-Id: Ib0981400883631f56940288f8a32fbc5f3985dfb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340067
Reviewed-by: Sigmund Cherem <sigmund@google.com >
Commit-Queue: Stephen Adams <sra@google.com >
2023-12-06 19:05:19 +00:00
Stephen Adams
073def1334
[dart2js] Add codegen test for logical operator generation
...
Change-Id: I5f86fdf4e58122a234dc2c7b16e1e16ec44d0d83
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/297360
Commit-Queue: Stephen Adams <sra@google.com >
Reviewed-by: Nate Biggs <natebiggs@google.com >
2023-04-24 18:47:14 +00:00