Lines Matching refs:block

46 static void AddToListForLinearization(ArenaVector<HBasicBlock*>* worklist, HBasicBlock* block) {
47 HLoopInformation* block_loop = block->GetLoopInformation();
55 // The block can be processed immediately.
59 worklist->insert(insert_pos.base(), block);
65 // - Back-edge is the last block before loop exits.
67 // (1): Record the number of forward predecessors for each block. This is to
75 HBasicBlock* block = it.Current();
76 size_t number_of_forward_predecessors = block->GetPredecessors().size();
77 if (block->IsLoopHeader()) {
78 number_of_forward_predecessors -= block->GetLoopInformation()->NumberOfBackEdges();
80 forward_predecessors[block->GetBlockId()] = number_of_forward_predecessors;
83 // (2): Following a worklist approach, first start with the entry block, and
85 // successor block are visited, the successor block is added in the worklist
108 // Each instruction gets a lifetime position, and a block gets a lifetime
110 // the block they are in. Phi instructions have the lifetime start of their block as
118 HBasicBlock* block = it.Current();
119 block->SetLifetimeStart(lifetime_position);
121 for (HInstructionIterator inst_it(block->GetPhis()); !inst_it.Done(); inst_it.Advance()) {
135 // Add a null marker to notify we are starting a block.
138 for (HInstructionIterator inst_it(block->GetInstructions()); !inst_it.Done();
154 block->SetLifetimeEnd(lifetime_position);
161 HBasicBlock* block = it.Current();
162 block_infos_[block->GetBlockId()] =
163 new (graph_->GetArena()) BlockInfo(graph_->GetArena(), *block, number_of_ssa_values_);
210 // Do a post order visit, adding inputs of instructions live in the block where
213 HBasicBlock* block = it.Current();
215 BitVector* kill = GetKillSet(*block);
216 BitVector* live_in = GetLiveInSet(*block);
218 // Set phi inputs of successors of this block corresponding to this block
220 for (HBasicBlock* successor : block->GetSuccessors()) {
232 size_t phi_input_index = successor->GetPredecessorIndexOf(block);
236 input->GetLiveInterval()->AddPhiUse(phi, phi_input_index, block);
237 // A phi input whose last user is the phi dies at the end of the predecessor block,
244 // Add a range that covers this block to all instructions live_in because of successors.
245 // Instructions defined in this block will have their start of the range adjusted.
248 current->GetLiveInterval()->AddRange(block->GetLifetimeStart(), block->GetLifetimeEnd());
251 for (HBackwardInstructionIterator back_it(block->GetInstructions()); !back_it.Done();
298 // Kill phis defined in this block.
299 for (HInstructionIterator inst_it(block->GetPhis()); !inst_it.Done(); inst_it.Advance()) {
311 if (block->IsLoopHeader()) {
313 CheckNoLiveInIrreducibleLoop(*block);
315 size_t last_position = block->GetLoopInformation()->GetLifetimeEnd();
320 current->GetLiveInterval()->AddLoopRange(block->GetLifetimeStart(), last_position);
332 const HBasicBlock& block = *it.Current();
337 if (UpdateLiveOut(block) && UpdateLiveIn(block)) {
339 CheckNoLiveInIrreducibleLoop(block);
347 bool SsaLivenessAnalysis::UpdateLiveOut(const HBasicBlock& block) {
348 BitVector* live_out = GetLiveOutSet(block);
350 // The live_out set of a block is the union of live_in sets of its successors.
351 for (HBasicBlock* successor : block.GetSuccessors()) {
360 bool SsaLivenessAnalysis::UpdateLiveIn(const HBasicBlock& block) {
361 BitVector* live_out = GetLiveOutSet(block);
362 BitVector* kill = GetKillSet(block);
363 BitVector* live_in = GetLiveInSet(block);
366 // by this block.
390 // If the start of this interval is at a block boundary, we look at the
391 // location of the interval in blocks preceding the block this interval
394 HBasicBlock* block = liveness.GetBlockFromPosition(GetStart() / 2);
396 for (HBasicBlock* predecessor : block->GetPredecessors()) {