diff options
author | 2022-08-19 10:28:11 +0100 | |
---|---|---|
committer | 2022-09-02 14:06:33 +0000 | |
commit | 7023bf8227b3f46f4c3cc98e18889f54a584cd16 (patch) | |
tree | ba7bbad88a339908faea59a19c3b17aad23c67d6 /compiler/optimizing/nodes.h | |
parent | 70d95654bad53085e12a96864c38187c504bdaa1 (diff) |
Remove instructions from dead blocks when building the dominator tree
We now remove the instructions to free up memory. We have to refactor
methods a little bit to avoid removing instructions as users twice,
since we do not support that.
Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b
Change-Id: Ia34c4a6af204952d295e5a2cb534115ced97ab07
Diffstat (limited to 'compiler/optimizing/nodes.h')
-rw-r--r-- | compiler/optimizing/nodes.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index 103d318710..98bcd38609 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -1351,11 +1351,14 @@ class HBasicBlock : public ArenaObject<kArenaAllocBasicBlock> { // skip updating those phis. void DisconnectFromSuccessors(const ArenaBitVector* visited = nullptr); - // Removes the catch phi uses of the instructions in `this`. If `remove_instruction` is set to - // true, it will also remove the instructions themselves. This method assumes the instructions - // have been removed from all users with the exception of catch phis because of missing - // exceptional edges in the graph. - void RemoveCatchPhiUses(bool remove_instruction); + // Removes the catch phi uses of the instructions in `this`, and then remove the instruction + // itself. If `building_dominator_tree` is true, it will not remove the instruction as user, since + // we do it in a previous step. This is a special case for building up the dominator tree: we want + // to eliminate uses before inputs but we don't have domination information, so we remove all + // connections from input/uses first before removing any instruction. + // This method assumes the instructions have been removed from all users with the exception of + // catch phis because of missing exceptional edges in the graph. + void RemoveCatchPhiUsesAndInstruction(bool building_dominator_tree); void AddInstruction(HInstruction* instruction); // Insert `instruction` before/after an existing instruction `cursor`. |