Lines Matching full:blocks

161 // Sorts the CFGs blocks using a reverse post-order depth-first traversal.
162 // Each block will be written into the Blocks array in order, and its BlockID
164 // block, and ID should be the total number of blocks.
165 unsigned BasicBlock::topologicalSort(SimpleArray<BasicBlock *> &Blocks, in topologicalSort() argument
170 ID = Block->topologicalSort(Blocks, ID); in topologicalSort()
172 // We may lose pointers to unreachable blocks. in topologicalSort()
175 Blocks[BlockID] = this; in topologicalSort()
181 // which guarantees that all blocks are serialized after their dominator and
187 // and no blocks are accessible via traversal of back-edges from the exit that
189 unsigned BasicBlock::topologicalFinalSort(SimpleArray<BasicBlock *> &Blocks, in topologicalFinalSort() argument
196 ID = DominatorNode.Parent->topologicalFinalSort(Blocks, ID); in topologicalFinalSort()
198 ID = Pred->topologicalFinalSort(Blocks, ID); in topologicalFinalSort()
199 assert(static_cast<size_t>(ID) < Blocks.size()); in topologicalFinalSort()
201 Blocks[BlockID] = this; in topologicalFinalSort()
259 // Renumber instructions in all blocks
262 for (auto *Block : Blocks) in renumberInstrs()
287 // 1) Removing unreachable blocks.
289 // 3) Topologically sorting the blocks into the "Blocks" array.
291 // Topologically sort the blocks starting from the entry block. in computeNormalForm()
292 unsigned NumUnreachableBlocks = Entry->topologicalSort(Blocks, Blocks.size()); in computeNormalForm()
294 // If there were unreachable blocks shift everything down, and delete them. in computeNormalForm()
295 for (unsigned I = NumUnreachableBlocks, E = Blocks.size(); I < E; ++I) { in computeNormalForm()
297 Blocks[NI] = Blocks[I]; in computeNormalForm()
298 Blocks[NI]->BlockID = NI; in computeNormalForm()
299 // FIXME: clean up predecessor pointers to unreachable blocks? in computeNormalForm()
301 Blocks.drop(NumUnreachableBlocks); in computeNormalForm()
305 for (auto *Block : Blocks) in computeNormalForm()
309 unsigned NumBlocks = Exit->topologicalFinalSort(Blocks, 0); in computeNormalForm()
310 assert(static_cast<size_t>(NumBlocks) == Blocks.size()); in computeNormalForm()
318 for (auto *Block : Blocks.reverse()) { in computeNormalForm()
324 for (auto *Block : Blocks) { in computeNormalForm()
329 for (auto *Block : Blocks.reverse()) { in computeNormalForm()