summaryrefslogtreecommitdiff
path: root/compiler/optimizing/execution_subgraph.cc
diff options
context:
space:
mode:
authorVladimir Marko <vmarko@google.com>2021-06-02 15:54:17 +0100
committerVladimir Marko <vmarko@google.com>2021-06-03 12:41:24 +0000
commit8350b7caf464c5c6f20b850199831d9dd0b50f92 (patch)
tree5d10dea54dc660b521fd249aec5cf739e2e25698 /compiler/optimizing/execution_subgraph.cc
parent61437483485304896f12fe35c587d3d699e6f86e (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. (cherry picked from commit 5c824937bb82adbde857bc99cb03c769c9f68f7b) Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 33650849 Merged-In: I323b9f144b258f0fab034794770971547ce94b59 Change-Id: If3fc9787fc0dc4a1a33dd5ca0f2dc972998c4da7
Diffstat (limited to 'compiler/optimizing/execution_subgraph.cc')
-rw-r--r--compiler/optimizing/execution_subgraph.cc10
1 files changed, 4 insertions, 6 deletions
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<kMaxFilterableSuccessors> {}),
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_) {