From d48da351fbfcdd538f83b690577e3c85eb0003a9 Mon Sep 17 00:00:00 2001 From: Santiago Aboy Solanes Date: Thu, 28 Jul 2022 17:58:53 +0100 Subject: 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 --- compiler/optimizing/nodes.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'compiler/optimizing/nodes.h') 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 { // 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); -- cgit v1.2.3-59-g8ed1b