More specifically on 64-bit platforms, when other heuristic fail:
- in AOT mode unbox all int typed phis.
- in JIT mode unbox all non-Smi int typed phis i.e. mixed
Mint/Smi phis.
This brings treatment of int phis closer to how we treat other
boxed phis.
This considerably improves AOT code quality for loops which
our current conservative heuristic does not currently hit,
for example:
void foo(int start, int end) {
for (var i = start; i < end; i++) {
}
}
Code like this would use a boxed Phi previously which does not make
sense.
In JIT mode to really benefit from aggressive unboxing we
might need to shift from over-reliance on Smi operations, e.g.
when phi is unboxed we want to cascade that through and unbox
operations which are performed on it transitively. This requires
much more sophisticated algorithm and is outside of scope for this
change.
In AOT we in general treat all arithmetic operations as operations
over 64-bit int values so unboxing phis makes more sense.
As a result of this change we see small improvement in code size:
flutter_gallery_app_so_gzip_size -0.2392%
TEST=ci
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try
Change-Id: Iae9a16f353e53f649da4e665d2812ad47099a674
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/187860
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
The two existing places where IR is built are changed to use this new
helper. It supports running normal JIT/AOT passes as well as a
user-specified set of passes.
In order to allow vm/cc tests to make assertions about AOT pipeline this CL
enables the DART_PRECOMPILER define in run_vm_tests binary (similar to
gen_snapshot, run_vm_tests has now JIT and AOT support)
Change-Id: Ib51a024a81e0291e89d20860b8b9a2762611426c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98482
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
Rationale:
Finds general bounds on an induction variable by
looking at loop exits that use strict comparisons.
An intended client is bounds-check-elimination (AOT).
Change-Id: Icfd6481aad9669c15b78630e4322667cfce7c1ef
Reviewed-on: https://dart-review.googlesource.com/c/87485
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Rationale:
The more one knows about loops, the better!
This introduces a rigorous framework for detecting
induction variables (more precise "sequence" variables).
Even though this is already pretty general, in the
future we can expand this on a "need to" base, recognizing
more operators (shifts, negate, etc.) and more classes
of induction (perhaps geometric, polynomial, etc.).
Change-Id: I82a14515e8ae946d520ee470cd31046f6a58af7d
Reviewed-on: https://dart-review.googlesource.com/c/81743
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>