diff options
author | 2012-12-14 13:35:28 -0800 | |
---|---|---|
committer | 2013-02-06 12:16:33 -0800 | |
commit | 4ef3e45d7c6ec3c482a1a48f4df470811aa3cf0a (patch) | |
tree | 5d91ff23708048a2b453a5917dab82be1b545f91 /src/compiler/frontend.cc | |
parent | f84f99fe3a944310fdfb6f17836079ac5c48c799 (diff) |
Compiler constant handling rework
In preparation for de-optimization, reworked the constant
handling mechanism. Also took advantage of knowledge of
constant operands (particularly for long operations).
Significant performance improvements for Mandelbrot
(~60 seconds to ~34 seconds). Minor improvements in other
benchmarks.
The new constant handling breaks two of the existing
optimization passes: "Skip Large Method" and "Load/Store
Elimization."
I don't intend to update the large method optimization
because it will be superceeded by the upcoming interpreter/
fingerprinting mechanism. Leaving the code in place for
now in order to compare compile-time improvements with
fingerprinting/interpret. All related code will be deleted
when that is complete.
The load/store elimination pass needs some rework to handle
uses of multiple-register loads and stores. It will be
updated & restored in a future CL.
Change-Id: Ia979abaf51b8ae81bbb0428031cbcea854625fac
Diffstat (limited to 'src/compiler/frontend.cc')
-rw-r--r-- | src/compiler/frontend.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/compiler/frontend.cc b/src/compiler/frontend.cc index 6ccbc07180..6eb117a200 100644 --- a/src/compiler/frontend.cc +++ b/src/compiler/frontend.cc @@ -66,13 +66,13 @@ extern "C" void ArtUnInitQuickCompilerContext(art::Compiler& compiler) { /* Default optimizer/debug setting for the compiler. */ static uint32_t kCompilerOptimizerDisableFlags = 0 | // Disable specific optimizations - //(1 << kLoadStoreElimination) | + (1 << kLoadStoreElimination) | //(1 << kLoadHoisting) | //(1 << kSuppressLoads) | //(1 << kNullCheckElimination) | //(1 << kPromoteRegs) | //(1 << kTrackLiveTemps) | - //(1 << kSkipLargeMethodOptimization) | + (1 << kSkipLargeMethodOptimization) | //(1 << kSafeOptimizations) | //(1 << kBBOpt) | //(1 << kMatch) | @@ -972,6 +972,7 @@ static CompiledMethod* CompileMethod(Compiler& compiler, cur_block = ProcessCanBranch(cu.get(), cur_block, insn, cur_offset, width, flags, code_ptr, code_end); } else if (flags & Instruction::kReturn) { + cur_block->has_return = true; cur_block->fall_through = exit_block; InsertGrowableList(cu.get(), exit_block->predecessors, reinterpret_cast<uintptr_t>(cur_block)); @@ -1078,10 +1079,9 @@ static CompiledMethod* CompileMethod(Compiler& compiler, } /* Do constant propagation */ - // TODO: Probably need to make these expandable to support new ssa names - // introducted during MIR optimization passes - cu->is_constant_v = AllocBitVector(cu.get(), cu->num_ssa_regs, - false /* not expandable */); + cu->is_constant_v = AllocBitVector(cu.get(), cu->num_ssa_regs, false /* not expandable */); + cu->must_flush_constant_v = AllocBitVector(cu.get(), cu->num_ssa_regs, + false /* not expandable */); cu->constant_values = static_cast<int*>(NewMem(cu.get(), sizeof(int) * cu->num_ssa_regs, true, kAllocDFInfo)); DataFlowAnalysisDispatcher(cu.get(), DoConstantPropogation, |