summaryrefslogtreecommitdiff
path: root/compiler/optimizing/dead_code_elimination.cc
diff options
context:
space:
mode:
author Santiago Aboy Solanes <solanes@google.com> 2024-03-22 10:45:15 +0000
committer Santiago Aboy Solanes <solanes@google.com> 2024-03-25 13:43:14 +0000
commit56dcaeec46dd53e271d6f201d2028996bf19f9dd (patch)
treeea607494f1912d60e838be94919e25db2ec3ac89 /compiler/optimizing/dead_code_elimination.cc
parent9c4a2b5bb3695349e31a00492731e578e8853a21 (diff)
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
Diffstat (limited to 'compiler/optimizing/dead_code_elimination.cc')
-rw-r--r--compiler/optimizing/dead_code_elimination.cc8
1 files changed, 1 insertions, 7 deletions
diff --git a/compiler/optimizing/dead_code_elimination.cc b/compiler/optimizing/dead_code_elimination.cc
index fe1361c935..f44f4b577b 100644
--- a/compiler/optimizing/dead_code_elimination.cc
+++ b/compiler/optimizing/dead_code_elimination.cc
@@ -592,10 +592,7 @@ struct HDeadCodeElimination::TryBelongingInformation {
TryBelongingInformation(HGraph* graph, ScopedArenaAllocator* allocator)
: blocks_in_try(allocator, graph->GetBlocks().size(), /*expandable=*/false, kArenaAllocDCE),
coalesced_try_entries(
- allocator, graph->GetBlocks().size(), /*expandable=*/false, kArenaAllocDCE) {
- blocks_in_try.ClearAllBits();
- coalesced_try_entries.ClearAllBits();
- }
+ allocator, graph->GetBlocks().size(), /*expandable=*/false, kArenaAllocDCE) {}
// Which blocks belong in the try.
ArenaBitVector blocks_in_try;
@@ -803,7 +800,6 @@ bool HDeadCodeElimination::RemoveEmptyIfs() {
ScopedArenaAllocator allocator(graph_->GetArenaStack());
ArenaBitVector visited_blocks(
&allocator, graph_->GetBlocks().size(), /*expandable=*/ false, kArenaAllocDCE);
- visited_blocks.ClearAllBits();
HBasicBlock* merge_true = true_block;
visited_blocks.SetBit(merge_true->GetBlockId());
while (merge_true->IsSingleGoto()) {
@@ -827,7 +823,6 @@ bool HDeadCodeElimination::RemoveEmptyIfs() {
ScopedArenaQueue<HInstruction*> maybe_remove(allocator.Adapter(kArenaAllocDCE));
ArenaBitVector visited(
&allocator, graph_->GetCurrentInstructionId(), /*expandable=*/ false, kArenaAllocDCE);
- visited.ClearAllBits();
maybe_remove.push(if_instr->InputAt(0));
visited.SetBit(if_instr->GetId());
@@ -879,7 +874,6 @@ bool HDeadCodeElimination::RemoveDeadBlocks(bool force_recomputation,
// Classify blocks as reachable/unreachable.
ArenaBitVector live_blocks(&allocator, graph_->GetBlocks().size(), false, kArenaAllocDCE);
- live_blocks.ClearAllBits();
MarkReachableBlocks(graph_, &live_blocks);
bool removed_one_or_more_blocks = false;