diff options
author | 2014-06-05 22:34:57 +0000 | |
---|---|---|
committer | 2014-06-05 22:34:57 +0000 | |
commit | 25c4f6a25b3de9b9d7ca5162f1629753a0b7f003 (patch) | |
tree | ea037b8bffd0568edbb835fd1ed06740734375f8 /compiler/dex/mir_graph.h | |
parent | 86e48ce0e82c13d8af470e7c2abe1bfb3c1e0136 (diff) | |
parent | 04f4d8abe45d6e79eca983e057de76aea24b7df9 (diff) |
Merge "Add an optimization for removing redundant suspend tests in ART"
Diffstat (limited to 'compiler/dex/mir_graph.h')
-rw-r--r-- | compiler/dex/mir_graph.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/compiler/dex/mir_graph.h b/compiler/dex/mir_graph.h index 38cd5ee449..b6cec662c3 100644 --- a/compiler/dex/mir_graph.h +++ b/compiler/dex/mir_graph.h @@ -192,6 +192,7 @@ enum OatMethodAttributes { typedef uint16_t BasicBlockId; static const BasicBlockId NullBasicBlockId = 0; +static constexpr bool kLeafOptimization = false; /* * In general, vreg/sreg describe Dalvik registers that originated with dx. However, @@ -1055,6 +1056,20 @@ class MIRGraph { void HandleSSADef(int* defs, int dalvik_reg, int reg_index); bool InferTypeAndSize(BasicBlock* bb, MIR* mir, bool changed); + // Used for removing redudant suspend tests + void AppendGenSuspendTestList(BasicBlock* bb) { + if (gen_suspend_test_list_.Size() == 0 || + gen_suspend_test_list_.Get(gen_suspend_test_list_.Size() - 1) != bb) { + gen_suspend_test_list_.Insert(bb); + } + } + + /* This is used to check if there is already a method call dominating the + * source basic block of a backedge and being dominated by the target basic + * block of the backedge. + */ + bool HasSuspendTestBetween(BasicBlock* source, BasicBlockId target_id); + protected: int FindCommonParent(int block1, int block2); void ComputeSuccLineIn(ArenaBitVector* dest, const ArenaBitVector* src1, @@ -1162,6 +1177,7 @@ class MIRGraph { GrowableArray<MirSFieldLoweringInfo> sfield_lowering_infos_; GrowableArray<MirMethodLoweringInfo> method_lowering_infos_; static const uint64_t oat_data_flow_attributes_[kMirOpLast]; + GrowableArray<BasicBlock*> gen_suspend_test_list_; // List of blocks containing suspend tests friend class ClassInitCheckEliminationTest; friend class LocalValueNumberingTest; |