diff options
| author | 2015-03-27 15:23:02 +0600 | |
|---|---|---|
| committer | 2015-03-27 15:40:11 +0600 | |
| commit | 356a1811f2f79d98194475fdbfb5f6b7768455b5 (patch) | |
| tree | d3b39e9b1f2d170386a71c5d0024f70579e43bae /compiler/dex/quick/codegen_util.cc | |
| parent | 03910065cd025ecb07781b85c2240be69c202d75 (diff) | |
Quick: Finding upper half of kMirOpCheckPart2 should passthough empty blocks
Mir2Lir::InitReferenceVRegs trying to find throwing instruction for
kMirOpCheckPart2 should traverse possible empty blocks which compiler
optimizations could generate between them.
Change-Id: I2ab29dd36635fd4c4ef2dd81b51e571e206775e6
Signed-off-by: Pavel Vyssotski <pavel.n.vyssotski@intel.com>
Diffstat (limited to 'compiler/dex/quick/codegen_util.cc')
| -rw-r--r-- | compiler/dex/quick/codegen_util.cc | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/compiler/dex/quick/codegen_util.cc b/compiler/dex/quick/codegen_util.cc index bd479bef5b..df72830801 100644 --- a/compiler/dex/quick/codegen_util.cc +++ b/compiler/dex/quick/codegen_util.cc @@ -1378,11 +1378,16 @@ void Mir2Lir::InitReferenceVRegs(BasicBlock* bb, BitVector* references) { // In Mir2Lir::MethodBlockCodeGen() we have artificially moved the throwing // instruction to the previous block. However, the MIRGraph data used above // doesn't reflect that, so we still need to process that MIR insn here. - DCHECK_EQ(bb->predecessors.size(), 1u); - BasicBlock* pred_bb = mir_graph_->GetBasicBlock(bb->predecessors[0]); - DCHECK(pred_bb != nullptr); - DCHECK(pred_bb->last_mir_insn != nullptr); - UpdateReferenceVRegsLocal(nullptr, pred_bb->last_mir_insn, references); + MIR* mir = nullptr; + BasicBlock* pred_bb = bb; + // Traverse empty blocks. + while (mir == nullptr && pred_bb->predecessors.size() == 1u) { + pred_bb = mir_graph_->GetBasicBlock(bb->predecessors[0]); + DCHECK(pred_bb != nullptr); + mir = pred_bb->last_mir_insn; + } + DCHECK(mir != nullptr); + UpdateReferenceVRegsLocal(nullptr, mir, references); } } |