Loop detection, improved reg allocation
Detect loops and loop nesting depth, and use the latter to
weight register uses (which are then used to determine which
registers to promote).
Also:
o Fixed typo that prevented squashing of useless fp reg copies
o Rescheduled array access checks to hide latency of limit load.
o Add basic-block optimization pass to remove duplicate range
checks.
o Fixed bug that prevented recognition of redundant null
checks following iput-wide and aput-wide.
Change-Id: Icfbae39e89b1d14b8703ad6bbb0b29c0635fed1e
diff --git a/src/compiler/Frontend.cc b/src/compiler/Frontend.cc
index fc7fcb4..d97c20f 100644
--- a/src/compiler/Frontend.cc
+++ b/src/compiler/Frontend.cc
@@ -34,7 +34,7 @@
//(1 << kTrackLiveTemps) |
//(1 << kSkipLargeMethodOptimization) |
//(1 << kSafeOptimizations) |
- (1 << kBBOpt) |
+ //(1 << kBBOpt) |
0;
uint32_t compilerDebugFlags = 0 | // Enable debug/testing modes
@@ -967,13 +967,17 @@
/* Perform SSA transformation for the whole method */
oatMethodSSATransformation(cUnit.get());
+ /* Detect loops */
+ oatMethodLoopDetection(cUnit.get());
+
+ /* Count uses */
+ oatMethodUseCount(cUnit.get());
+
/* Perform null check elimination */
oatMethodNullCheckElimination(cUnit.get());
-#if 0
/* Do some basic block optimizations */
oatMethodBasicBlockOptimization(cUnit.get());
-#endif
oatInitializeRegAlloc(cUnit.get()); // Needs to happen after SSA naming