diff options
| author | 2012-09-09 14:41:03 -0700 | |
|---|---|---|
| committer | 2012-09-09 14:41:03 -0700 | |
| commit | 1a0806c6847a9dc5cc6d73460d7e8ad3183b5c49 (patch) | |
| tree | 380a8b0796e3ee94072457013de1ad8e94e9a287 /src/compiler/Frontend.cc | |
| parent | 324e190e9de0d81d39d88474e189acef9b10bcc8 (diff) | |
| parent | d1643e41ef242ae656f667bf3c8b0324635cefd3 (diff) | |
Merge "Basic block combine pass" into dalvik-dev
Diffstat (limited to 'src/compiler/Frontend.cc')
| -rw-r--r-- | src/compiler/Frontend.cc | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/compiler/Frontend.cc b/src/compiler/Frontend.cc index 8c403c599e..4aa0ac89e9 100644 --- a/src/compiler/Frontend.cc +++ b/src/compiler/Frontend.cc @@ -80,6 +80,7 @@ static uint32_t kCompilerDebugFlags = 0 | // Enable debug/testing modes //(1 << kDebugShowMemoryUsage) | //(1 << kDebugShowNops) | //(1 << kDebugCountOpcodes) | + //(1 << kDebugDumpCheckStats) | #if defined(ART_USE_QUICK_COMPILER) //(1 << kDebugDumpBitcodeFile) | //(1 << kDebugVerifyBitcode) | @@ -315,6 +316,7 @@ void oatDumpCFG(CompilationUnit* cUnit, const char* dirPrefix) BasicBlock *bb = (BasicBlock *) oatGrowableListGetElement(blockList, blockIdx); if (bb == NULL) break; + if (bb->blockType == kDead) continue; if (bb->blockType == kEntryBlock) { fprintf(file, " entry_%d [shape=Mdiamond];\n", bb->id); } else if (bb->blockType == kExitBlock) { @@ -1049,18 +1051,16 @@ CompiledMethod* oatCompileMethod(Compiler& compiler, } } -#if defined(ART_USE_QUICK_COMPILER) - if (cUnit->genBitcode) { - // Bitcode generation requires full dataflow analysis, no qdMode - cUnit->qdMode = false; - } -#endif - if (cUnit->qdMode) { +#if !defined(ART_USE_QUICK_COMPILER) + // Bitcode generation requires full dataflow analysis cUnit->disableDataflow = true; +#endif // Disable optimization which require dataflow/ssa cUnit->disableOpt |= +#if !defined(ART_USE_QUICK_COMPILER) (1 << kNullCheckElimination) | +#endif (1 << kBBOpt) | (1 << kPromoteRegs); if (cUnit->printMe) { @@ -1104,9 +1104,16 @@ CompiledMethod* oatCompileMethod(Compiler& compiler, /* Perform null check elimination */ oatMethodNullCheckElimination(cUnit.get()); + /* Combine basic blocks where possible */ + oatMethodBasicBlockCombine(cUnit.get()); + /* Do some basic block optimizations */ oatMethodBasicBlockOptimization(cUnit.get()); + if (cUnit->enableDebug & (1 << kDebugDumpCheckStats)) { + oatDumpCheckStats(cUnit.get()); + } + oatInitializeRegAlloc(cUnit.get()); // Needs to happen after SSA naming /* Allocate Registers using simple local allocation scheme */ |