Lines Matching refs:block

39     HBasicBlock* block = worklist.back();  in MarkReachableBlocks()  local
41 int block_id = block->GetBlockId(); in MarkReachableBlocks()
44 ArrayRef<HBasicBlock* const> live_successors(block->GetSuccessors()); in MarkReachableBlocks()
45 HInstruction* last_instruction = block->GetLastInstruction(); in MarkReachableBlocks()
72 DCHECK_EQ(live_successors[0], block->GetSuccessors()[switch_index]); in MarkReachableBlocks()
90 void HDeadCodeElimination::MaybeRecordDeadBlock(HBasicBlock* block) { in MaybeRecordDeadBlock() argument
93 block->GetPhis().CountSize() + block->GetInstructions().CountSize()); in MaybeRecordDeadBlock()
149 static bool RemoveNonNullControlDependences(HBasicBlock* block, HBasicBlock* throws) { in RemoveNonNullControlDependences() argument
151 if (!block->EndsWithIf()) { in RemoveNonNullControlDependences()
154 HIf* ifs = block->GetLastInstruction()->AsIf(); in RemoveNonNullControlDependences()
189 if (user_block != block && in RemoveNonNullControlDependences()
191 block->Dominates(user_block)) { in RemoveNonNullControlDependences()
242 for (HBasicBlock* block : graph_->GetReversePostOrder()) { in SimplifyAlwaysThrows()
243 HInstruction* first = block->GetFirstInstruction(); in SimplifyAlwaysThrows()
244 HInstruction* last = block->GetLastInstruction(); in SimplifyAlwaysThrows()
249 block->GetPhis().IsEmpty() && in SimplifyAlwaysThrows()
250 block->GetPredecessors().size() == 1u) { in SimplifyAlwaysThrows()
251 DCHECK_EQ(block->GetSuccessors().size(), 1u); in SimplifyAlwaysThrows()
252 HBasicBlock* pred = block->GetSinglePredecessor(); in SimplifyAlwaysThrows()
253 HBasicBlock* succ = block->GetSingleSuccessor(); in SimplifyAlwaysThrows()
258 !block->Dominates(pred) && in SimplifyAlwaysThrows()
262 block->ReplaceSuccessor(succ, exit); in SimplifyAlwaysThrows()
267 if (RemoveNonNullControlDependences(pred, block)) { in SimplifyAlwaysThrows()
325 for (HBasicBlock* block : graph_->GetReversePostOrder()) { in SimplifyIfs()
326 HInstruction* last = block->GetLastInstruction(); in SimplifyIfs()
327 HInstruction* first = block->GetFirstInstruction(); in SimplifyIfs()
328 if (!block->IsCatchBlock() && in SimplifyIfs()
330 block->HasSinglePhi() && in SimplifyIfs()
331 block->GetFirstPhi()->HasOnlyOneNonEnvironmentUse()) { in SimplifyIfs()
332 bool has_only_phi_and_if = (last == first) && (last->InputAt(0) == block->GetFirstPhi()); in SimplifyIfs()
336 HasInput(first->AsCondition(), block->GetFirstPhi()) && in SimplifyIfs()
342 DCHECK(!block->IsLoopHeader()); in SimplifyIfs()
343 HPhi* phi = block->GetFirstPhi()->AsPhi(); in SimplifyIfs()
368 HBasicBlock* predecessor_to_update = block->GetPredecessors()[i]; in SimplifyIfs()
377 predecessor_to_update->ReplaceSuccessor(block, successor_to_update); in SimplifyIfs()
380 if (block->IsInLoop()) { in SimplifyIfs()
390 if (block->GetPredecessors().size() == 1) { in SimplifyIfs()
392 block->RemovePhi(phi); in SimplifyIfs()
399 block->RemoveInstruction(first); in SimplifyIfs()
430 HBasicBlock* block = graph_->GetReversePostOrder()[i]; in ConnectSuccessiveBlocks() local
431 DCHECK(!block->IsEntryBlock()); in ConnectSuccessiveBlocks()
432 while (block->GetLastInstruction()->IsGoto()) { in ConnectSuccessiveBlocks()
433 HBasicBlock* successor = block->GetSingleSuccessor(); in ConnectSuccessiveBlocks()
438 block->MergeWith(successor); in ConnectSuccessiveBlocks()
441 DCHECK_EQ(block, graph_->GetReversePostOrder()[i]); in ConnectSuccessiveBlocks()
462 for (HBasicBlock* block : graph_->GetPostOrder()) { in RemoveDeadBlocks()
463 int id = block->GetBlockId(); in RemoveDeadBlocks()
465 MaybeRecordDeadBlock(block); in RemoveDeadBlocks()
466 block->DisconnectAndDelete(); in RemoveDeadBlocks()
468 if (block->IsInLoop()) { in RemoveDeadBlocks()
493 for (HBasicBlock* block : graph_->GetPostOrder()) { in RemoveDeadInstructions()
496 HBackwardInstructionIterator i(block->GetInstructions()); in RemoveDeadInstructions()
504 block->RemoveInstruction(inst); in RemoveDeadInstructions()