diff options
author | Jean Christophe Beyler <jean.christophe.beyler@intel.com> | 2014-05-01 15:36:22 -0700 |
---|---|---|
committer | Jean Christophe Beyler <jean.christophe.beyler@intel.com> | 2014-05-02 13:20:32 -0700 |
commit | cb73fb35e5f7c575ed491c0c8e2d2b1a0a22ea2e (patch) | |
tree | e89c34c5bb21f69c8c0104ba4b679a0a1e28dbce /compiler/dex/mir_graph.h | |
parent | 851a9a9c0c9b94e24eb0b3d322e810bb388a81a0 (diff) | |
download | art-cb73fb35e5f7c575ed491c0c8e2d2b1a0a22ea2e.tar.gz art-cb73fb35e5f7c575ed491c0c8e2d2b1a0a22ea2e.tar.bz2 art-cb73fb35e5f7c575ed491c0c8e2d2b1a0a22ea2e.zip |
ART: Better SSA Allocation when recreating SSA
The SSA calculation is not allocation friendly. This makes the
SSARepresentation remember how much is allocated and not reallocate
if SSA should be recalculated.
Also added some allocation friendly code for the dominance code.
Signed-off-by: Jean Christophe Beyler <jean.christophe.beyler@intel.com>
Change-Id: I6418b402434bd850b45771c75b7631b7b84a8f66
Diffstat (limited to 'compiler/dex/mir_graph.h')
-rw-r--r-- | compiler/dex/mir_graph.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/compiler/dex/mir_graph.h b/compiler/dex/mir_graph.h index 2c125f6aa0..f64f3e09fa 100644 --- a/compiler/dex/mir_graph.h +++ b/compiler/dex/mir_graph.h @@ -223,7 +223,8 @@ struct BasicBlockDataFlow { ArenaBitVector* def_v; ArenaBitVector* live_in_v; ArenaBitVector* phi_v; - int32_t* vreg_to_ssa_map; + int32_t* vreg_to_ssa_map_exit; + int32_t* vreg_to_ssa_map_entrance; ArenaBitVector* ending_check_v; // For null check and class init check elimination. }; @@ -236,6 +237,8 @@ struct BasicBlockDataFlow { * we may want to revisit in the future. */ struct SSARepresentation { + int16_t num_uses_allocated; + int16_t num_defs_allocated; int16_t num_uses; int16_t num_defs; int32_t* uses; @@ -858,6 +861,10 @@ class MIRGraph { void CombineBlocks(BasicBlock* bb); void ClearAllVisitedFlags(); + + void AllocateSSAUseData(MIR *mir, int num_uses); + void AllocateSSADefData(MIR *mir, int num_defs); + /* * IsDebugBuild sanity check: keep track of the Dex PCs for catch entries so that later on * we can verify that all catch entries have native PC entries. @@ -943,6 +950,7 @@ class MIRGraph { GrowableArray<uint32_t> use_counts_; // Weighted by nesting depth GrowableArray<uint32_t> raw_use_counts_; // Not weighted unsigned int num_reachable_blocks_; + unsigned int max_num_reachable_blocks_; GrowableArray<BasicBlockId>* dfs_order_; GrowableArray<BasicBlockId>* dfs_post_order_; GrowableArray<BasicBlockId>* dom_post_order_traversal_; |