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/code_sinking.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'compiler/optimizing/code_sinking.cc') diff --git a/compiler/optimizing/code_sinking.cc b/compiler/optimizing/code_sinking.cc index a2371817ee..0abcaea719 100644 --- a/compiler/optimizing/code_sinking.cc +++ b/compiler/optimizing/code_sinking.cc @@ -333,10 +333,9 @@ void CodeSinking::SinkCodeToUncommonBranch(HBasicBlock* end_block) { size_t number_of_instructions = graph_->GetCurrentInstructionId(); ScopedArenaVector worklist(allocator.Adapter(kArenaAllocMisc)); - ArenaBitVector processed_instructions(&allocator, number_of_instructions, /* expandable= */ false); - processed_instructions.ClearAllBits(); + ArenaBitVector processed_instructions( + &allocator, number_of_instructions, /* expandable= */ false); ArenaBitVector post_dominated(&allocator, graph_->GetBlocks().size(), /* expandable= */ false); - post_dominated.ClearAllBits(); // Step (1): Visit post order to get a subset of blocks post dominated by `end_block`. // TODO(ngeoffray): Getting the full set of post-dominated should be done by @@ -411,7 +410,6 @@ void CodeSinking::SinkCodeToUncommonBranch(HBasicBlock* end_block) { // Step (2): iterate over the worklist to find sinking candidates. ArenaBitVector instructions_that_can_move( &allocator, number_of_instructions, /* expandable= */ false); - instructions_that_can_move.ClearAllBits(); ScopedArenaVector> instructions_to_move( graph_->GetBlocks().size(), ScopedArenaVector(allocator.Adapter(kArenaAllocMisc)), -- cgit v1.2.3-59-g8ed1b