Lines Matching refs:bb
27 for (BasicBlock* bb = iter.Next(); bb != NULL; bb = iter.Next()) {
28 bb->visited = false;
32 BasicBlock* MIRGraph::NeedsVisit(BasicBlock* bb) {
33 if (bb != NULL) {
34 if (bb->visited || bb->hidden) {
35 bb = NULL;
38 return bb;
41 BasicBlock* MIRGraph::NextUnvisitedSuccessor(BasicBlock* bb) {
42 BasicBlock* res = NeedsVisit(GetBasicBlock(bb->fall_through));
44 res = NeedsVisit(GetBasicBlock(bb->taken));
46 if (bb->successor_block_list_type != kNotUsed) {
47 GrowableArray<SuccessorBlockInfo*>::Iterator iterator(bb->successor_blocks);
124 for (BasicBlock* bb = iter.Next(); bb != NULL; bb = iter.Next()) {
125 if (!bb->visited) {
126 bb->Hide(cu_);
134 * register idx is defined in BasicBlock bb.
136 bool MIRGraph::FillDefBlockMatrix(BasicBlock* bb) {
137 if (bb->data_flow_info == NULL) {
141 for (uint32_t idx : bb->data_flow_info->def_v->Indexes()) {
142 /* Block bb defines register idx */
143 def_block_matrix_[idx]->SetBit(bb->id);
162 for (BasicBlock* bb = iter.Next(); bb != NULL; bb = iter.Next()) {
163 FindLocalLiveIn(bb);
166 for (BasicBlock* bb = iter2.Next(); bb != NULL; bb = iter2.Next()) {
167 FillDefBlockMatrix(bb);
181 void MIRGraph::ComputeDomPostOrderTraversal(BasicBlock* bb) {
194 bb->visited = true;
195 work_stack.push_back(std::make_pair(bb, bb->i_dominated->Indexes().begin()));
239 bool MIRGraph::ComputeDominanceFrontier(BasicBlock* bb) {
241 if (bb->taken != NullBasicBlockId) {
242 CheckForDominanceFrontier(bb, GetBasicBlock(bb->taken));
244 if (bb->fall_through != NullBasicBlockId) {
245 CheckForDominanceFrontier(bb, GetBasicBlock(bb->fall_through));
247 if (bb->successor_block_list_type != kNotUsed) {
248 GrowableArray<SuccessorBlockInfo*>::Iterator iterator(bb->successor_blocks);
255 CheckForDominanceFrontier(bb, succ_bb);
260 for (uint32_t dominated_idx : bb->i_dominated->Indexes()) {
264 CheckForDominanceFrontier(bb, df_up_block);
272 void MIRGraph::InitializeDominationInfo(BasicBlock* bb) {
275 if (bb->dominators == NULL) {
276 bb->dominators = new (arena_) ArenaBitVector(arena_, num_total_blocks,
278 bb->i_dominated = new (arena_) ArenaBitVector(arena_, num_total_blocks,
280 bb->dom_frontier = new (arena_) ArenaBitVector(arena_, num_total_blocks,
283 bb->dominators->ClearAllBits();
284 bb->i_dominated->ClearAllBits();
285 bb->dom_frontier->ClearAllBits();
288 bb->dominators->SetInitialBits(num_total_blocks);
313 bool MIRGraph::ComputeblockIDom(BasicBlock* bb) {
315 if ((bb->id == NullBasicBlockId) || (bb == GetEntryBlock())) {
320 GrowableArray<BasicBlockId>::Iterator iter(bb->predecessors);
349 if (i_dom_list_[bb->dfs_id] != idom) {
350 i_dom_list_[bb->dfs_id] = idom;
357 bool MIRGraph::ComputeBlockDominators(BasicBlock* bb) {
358 if (bb == GetEntryBlock()) {
359 bb->dominators->ClearAllBits();
361 bb->dominators->Copy(GetBasicBlock(bb->i_dom)->dominators);
363 bb->dominators->SetBit(bb->id);
367 bool MIRGraph::SetDominators(BasicBlock* bb) {
368 if (bb != GetEntryBlock()) {
369 int idom_dfs_idx = i_dom_list_[bb->dfs_id];
373 bb->i_dom = i_dom->id;
374 /* Add bb to the i_dominated set of the immediate dominator block */
375 i_dom->i_dominated->SetBit(bb->id);
386 for (BasicBlock* bb = iter.Next(); bb != NULL; bb = iter.Next()) {
387 InitializeDominationInfo(bb);
406 for (BasicBlock* bb = iter2.Next(false); bb != NULL; bb = iter2.Next(change)) {
407 change = ComputeblockIDom(bb);
417 for (BasicBlock* bb = iter3.Next(); bb != NULL; bb = iter3.Next()) {
418 SetDominators(bb);
422 for (BasicBlock* bb = iter4.Next(); bb != NULL; bb = iter4.Next()) {
423 ComputeBlockDominators(bb);
429 for (BasicBlock* bb = iter5.Next(); bb != NULL; bb = iter5.Next()) {
430 ComputeDominanceFrontier(bb);
458 bool MIRGraph::ComputeBlockLiveIns(BasicBlock* bb) {
462 if (bb->data_flow_info == NULL) {
465 temp_dalvik_register_v->Copy(bb->data_flow_info->live_in_v);
466 BasicBlock* bb_taken = GetBasicBlock(bb->taken);
467 BasicBlock* bb_fall_through = GetBasicBlock(bb->fall_through);
470 bb->data_flow_info->def_v);
473 bb->data_flow_info->def_v);
474 if (bb->successor_block_list_type != kNotUsed) {
475 GrowableArray<SuccessorBlockInfo*>::Iterator iterator(bb->successor_blocks);
484 bb->data_flow_info->def_v);
488 if (!temp_dalvik_register_v->Equal(bb->data_flow_info->live_in_v)) {
489 bb->data_flow_info->live_in_v->Copy(temp_dalvik_register_v);
505 for (BasicBlock* bb = iter.Next(false); bb != NULL; bb = iter.Next(change)) {
506 change = ComputeBlockLiveIns(bb);
547 bool MIRGraph::InsertPhiNodeOperands(BasicBlock* bb) {
549 for (MIR* mir = bb->first_mir_insn; mir != NULL; mir = mir->next) {
557 GrowableArray<BasicBlockId>::Iterator iter(bb->predecessors);
558 size_t num_uses = bb->predecessors->Size();