From 5c824937bb82adbde857bc99cb03c769c9f68f7b Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Wed, 2 Jun 2021 15:54:17 +0100 Subject: 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 --- compiler/optimizing/execution_subgraph.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'compiler/optimizing/execution_subgraph.cc') diff --git a/compiler/optimizing/execution_subgraph.cc b/compiler/optimizing/execution_subgraph.cc index 5045e8db0b..6d105668c0 100644 --- a/compiler/optimizing/execution_subgraph.cc +++ b/compiler/optimizing/execution_subgraph.cc @@ -28,17 +28,15 @@ namespace art { -ExecutionSubgraph::ExecutionSubgraph(HGraph* graph, - bool analysis_possible, - ScopedArenaAllocator* allocator) +ExecutionSubgraph::ExecutionSubgraph(HGraph* graph, ScopedArenaAllocator* allocator) : graph_(graph), allocator_(allocator), - allowed_successors_(analysis_possible ? graph_->GetBlocks().size() : 0, + allowed_successors_(graph_->GetBlocks().size(), ~(std::bitset {}), allocator_->Adapter(kArenaAllocLSA)), unreachable_blocks_( - allocator_, analysis_possible ? graph_->GetBlocks().size() : 0, false, kArenaAllocLSA), - valid_(analysis_possible), + allocator_, graph_->GetBlocks().size(), /*expandable=*/ false, kArenaAllocLSA), + valid_(true), needs_prune_(false), finalized_(false) { if (valid_) { -- cgit v1.2.3-59-g8ed1b