diff options
author | 2021-06-02 15:54:17 +0100 | |
---|---|---|
committer | 2021-06-03 08:09:43 +0000 | |
commit | 5c824937bb82adbde857bc99cb03c769c9f68f7b (patch) | |
tree | 7aaa6cc94120e39ed93e3c0e127318f41e7bb456 /compiler/optimizing/execution_subgraph.h | |
parent | 95313c5d14447ff5d75f51263bfd82fc6352dd72 (diff) |
Reduce Partial LSE memory usage.
Instantiate ExecutionSubgraph only for partial singleton
candidates (currently NewInstance, possibly NewArray in the
future). This reduces "LSA" allocations.
Reserve memory for PartialLoadStoreEliminationHelper members
based on the number of partial singletons instead of the
number of reference infos. This reduces "LSE" allocations.
The peak scoped arena allocation for one compiled method
is reduced from
MEM: used: 97424004, allocated: 99006568, lost: 1115968
LSA 46015104
LSE 51408900
down to
MEM: used: 17000744, allocated: 26713880, lost: 3332496
GVN 17000744
where the LSA+LSE memory use is lower than GVN use.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 33650849
Change-Id: I323b9f144b258f0fab034794770971547ce94b59
Diffstat (limited to 'compiler/optimizing/execution_subgraph.h')
-rw-r--r-- | compiler/optimizing/execution_subgraph.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/compiler/optimizing/execution_subgraph.h b/compiler/optimizing/execution_subgraph.h index 7fabbaead1..05855c30d4 100644 --- a/compiler/optimizing/execution_subgraph.h +++ b/compiler/optimizing/execution_subgraph.h @@ -113,7 +113,7 @@ class BlockIdFilterThunk { // allocated in the entry block. This is a massively simplifying assumption but // means we can't partially remove objects that are repeatedly allocated in a // loop. -class ExecutionSubgraph : public ArenaObject<kArenaAllocLSA> { +class ExecutionSubgraph : public DeletableArenaObject<kArenaAllocLSA> { public: using BitVecBlockRange = IterationRange<TransformIterator<BitVector::IndexIterator, BlockIdToBlockTransformer>>; @@ -222,12 +222,11 @@ class ExecutionSubgraph : public ArenaObject<kArenaAllocLSA> { // to have a constant branching factor. static constexpr uint32_t kMaxFilterableSuccessors = 8; - // Instantiate a subgraph. analysis_possible controls whether or not to even - // attempt partial-escape analysis. It should be false if partial-escape - // analysis is not desired (eg when being used for instruction scheduling) or - // when the branching factor in the graph is too high. This is calculated once - // and passed down for performance reasons. - ExecutionSubgraph(HGraph* graph, bool analysis_possible, ScopedArenaAllocator* allocator); + // Instantiate a subgraph. The subgraph can be instantiated only if partial-escape + // analysis is desired (eg not when being used for instruction scheduling) and + // when the branching factor in the graph is not too high. These conditions + // are determined once and passed down for performance reasons. + ExecutionSubgraph(HGraph* graph, ScopedArenaAllocator* allocator); void Invalidate() { valid_ = false; |