Home | History | Annotate | Download | only in Analysis

Lines Matching full:blocks

164 // Sorts the CFGs blocks using a reverse post-order depth-first traversal.
165 // Each block will be written into the Blocks array in order, and its BlockID
167 // block, and ID should be the total number of blocks.
168 int BasicBlock::topologicalSort(SimpleArray<BasicBlock*>& Blocks, int ID) {
172 ID = Block->topologicalSort(Blocks, ID);
174 // We may lose pointers to unreachable blocks.
177 Blocks[BlockID] = this;
183 // which guarantees that all blocks are serialized after their dominator and
189 // and no blocks are accessable via traversal of back-edges from the exit that
191 int BasicBlock::topologicalFinalSort(SimpleArray<BasicBlock*>& Blocks, int ID) {
197 ID = DominatorNode.Parent->topologicalFinalSort(Blocks, ID);
199 ID = Pred->topologicalFinalSort(Blocks, ID);
200 assert(static_cast<size_t>(ID) < Blocks.size());
202 Blocks[BlockID] = this;
261 // Renumber instructions in all blocks
264 for (auto *Block : Blocks)
291 // 1) Removing unreachable blocks.
293 // 3) Topologically sorting the blocks into the "Blocks" array.
295 // Topologically sort the blocks starting from the entry block.
296 int NumUnreachableBlocks = Entry->topologicalSort(Blocks, Blocks.size());
298 // If there were unreachable blocks shift everything down, and delete them.
299 for (size_t I = NumUnreachableBlocks, E = Blocks.size(); I < E; ++I) {
301 Blocks[NI] = Blocks[I];
302 Blocks[NI]->BlockID = NI;
303 // FIXME: clean up predecessor pointers to unreachable blocks?
305 Blocks.drop(NumUnreachableBlocks);
309 for (auto *Block : Blocks)
313 int NumBlocks = Exit->topologicalFinalSort(Blocks, 0);
314 assert(static_cast<size_t>(NumBlocks) == Blocks.size());
322 for (auto *Block : Blocks.reverse()) {
328 for (auto *Block : Blocks) {
333 for (auto *Block : Blocks.reverse()) {