From 56dcaeec46dd53e271d6f201d2028996bf19f9dd Mon Sep 17 00:00:00 2001 From: Santiago Aboy Solanes Date: Fri, 22 Mar 2024 10:45:15 +0000 Subject: Remove extra uses of ClearAllBits ArenaBitVector creation guarantees it starts empty. Add a debug check to make sure this assumption doesn't change. Note that ArenaAllocator guarantees zero-initialized memory but ScopedArenaAllocators do not. This is fine either way since the BitVector constructor calls ClearAllBits. Bug: 329037671 Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b Change-Id: Icbf5e5dd1869e80b5d5828ecca9f13de30c0242b --- compiler/optimizing/nodes.cc | 5 ----- 1 file changed, 5 deletions(-) (limited to 'compiler/optimizing/nodes.cc') diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc index ba268560e8..f2cac19786 100644 --- a/compiler/optimizing/nodes.cc +++ b/compiler/optimizing/nodes.cc @@ -72,7 +72,6 @@ void HGraph::FindBackEdges(ArenaBitVector* visited) { // Nodes that we're currently visiting, indexed by block id. ArenaBitVector visiting( &allocator, blocks_.size(), /* expandable= */ false, kArenaAllocGraphBuilder); - visiting.ClearAllBits(); // Number of successors visited from a given node, indexed by block id. ScopedArenaVector successors_visited(blocks_.size(), 0u, @@ -219,7 +218,6 @@ GraphAnalysisResult HGraph::BuildDominatorTree() { ScopedArenaAllocator allocator(GetArenaStack()); ArenaBitVector visited(&allocator, blocks_.size(), false, kArenaAllocGraphBuilder); - visited.ClearAllBits(); // (1) Find the back edges in the graph doing a DFS traversal. FindBackEdges(&visited); @@ -890,7 +888,6 @@ void HLoopInformation::Populate() { graph->GetBlocks().size(), /* expandable= */ false, kArenaAllocGraphBuilder); - visited.ClearAllBits(); // Stop marking blocks at the loop header. visited.SetBit(header_->GetBlockId()); @@ -1221,7 +1218,6 @@ std::ostream& HInstruction::Dump(std::ostream& os, bool dump_args) { (graph != nullptr) ? graph->GetCurrentInstructionId() : 0u, /* expandable= */ (graph == nullptr), kArenaAllocMisc); - visited.ClearAllBits(); visited.SetBit(GetId()); // Keep a queue of instructions with their indentations. ScopedArenaDeque> queue(allocator.Adapter(kArenaAllocMisc)); @@ -1424,7 +1420,6 @@ void HInstruction::ReplaceUsesDominatedBy(HInstruction* dominator, graph->GetBlocks().size(), /* expandable= */ false, kArenaAllocMisc); - visited_blocks->ClearAllBits(); ScopedArenaAllocator allocator(graph->GetArenaStack()); ScopedArenaQueue worklist(allocator.Adapter(kArenaAllocMisc)); worklist.push(dominator_block); -- cgit v1.2.3-59-g8ed1b