diff options
author | 2022-07-28 17:58:53 +0100 | |
---|---|---|
committer | 2022-08-02 08:01:17 +0000 | |
commit | d48da351fbfcdd538f83b690577e3c85eb0003a9 (patch) | |
tree | 87c69a03d2b18b0f9cac1a50a7d491cf5ee89efb /compiler/optimizing/nodes.h | |
parent | 303f0354c94771444fe12aaeac0cd4250e072d04 (diff) |
Update the successor's Phis in RemoveDeadBlocks
When we remove a dead block, we update its successor's phis (as long
as the successor is still reachable). We can reuse code from
DisconnectAndDelete if we refactor it a little bit.
Bug: 240546614
Fixes: 240546614
Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b
Change-Id: I70c509bd1c9e392118bbf95c7aaac64faa46237f
Diffstat (limited to 'compiler/optimizing/nodes.h')
-rw-r--r-- | compiler/optimizing/nodes.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index a1a6747601..1ceb8f118a 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -1346,6 +1346,17 @@ class HBasicBlock : public ArenaObject<kArenaAllocBasicBlock> { // are safely updated. void DisconnectAndDelete(); + // Disconnects `this` from all its successors and updates their phis, if the successors have them. + // If `visited` is provided, it will use the information to know if a successor is reachable and + // 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); + void AddInstruction(HInstruction* instruction); // Insert `instruction` before/after an existing instruction `cursor`. void InsertInstructionBefore(HInstruction* instruction, HInstruction* cursor); |