Lines Matching refs:Block

165 class Block {  class
167 Block(const Block &) = delete;
168 Block(Block &&) = default;
169 Block &operator=(const Block &) = delete;
170 Block &operator=(Block &&) = default;
185 Block *ForcedSucc{nullptr};
187 Block *ForcedPred{nullptr};
194 explicit Block(size_t Index, uint64_t Size_, uint64_t EC) in Block() function in __anon97d149770111::Block
208 Block *Source;
210 Block *Target;
215 explicit Jump(Block *Source, Block *Target, uint64_t ExecutionCount) in Jump()
227 explicit Chain(uint64_t Id, Block *Block) in Chain() argument
228 : Id(Id), Score(0), Blocks(1, Block) {} in Chain()
238 const std::vector<Block *> &blocks() const { return Blocks; } in blocks()
269 void merge(Chain *Other, const std::vector<Block *> &MergedBlocks) { in merge()
293 std::vector<Block *> Blocks;
394 using BlockIter = std::vector<Block *>::const_iterator;
415 std::vector<Block *> getBlocks() const { in getBlocks()
416 std::vector<Block *> Result; in getBlocks()
425 const Block *getFirstBlock() const { return *Begin1; } in getFirstBlock()
495 auto &Block = AllBlocks[Pred]; in initialize() local
497 AllJumps.emplace_back(&Block, &SuccBlock, ExecutionCount); in initialize()
499 Block.OutJumps.push_back(&AllJumps.back()); in initialize()
506 for (auto &Block : AllBlocks) { in initialize() local
507 AllChains.emplace_back(Block.Index, &Block); in initialize()
508 Block.CurChain = &AllChains.back(); in initialize()
509 if (Block.ExecutionCount > 0) { in initialize()
516 for (auto &Block : AllBlocks) { in initialize() local
517 for (auto &Jump : Block.OutJumps) { in initialize()
519 auto CurEdge = Block.CurChain->getEdge(SuccBlock->CurChain); in initialize()
522 assert(SuccBlock->CurChain->getEdge(Block.CurChain) != nullptr); in initialize()
528 Block.CurChain->addEdge(SuccBlock->CurChain, &AllEdges.back()); in initialize()
529 SuccBlock->CurChain->addEdge(Block.CurChain, &AllEdges.back()); in initialize()
540 for (auto &Block : AllBlocks) { in mergeForcedPairs() local
541 if (SuccNodes[Block.Index].size() == 1 && in mergeForcedPairs()
542 PredNodes[SuccNodes[Block.Index][0]].size() == 1 && in mergeForcedPairs()
543 SuccNodes[Block.Index][0] != 0) { in mergeForcedPairs()
544 size_t SuccIndex = SuccNodes[Block.Index][0]; in mergeForcedPairs()
545 Block.ForcedSucc = &AllBlocks[SuccIndex]; in mergeForcedPairs()
546 AllBlocks[SuccIndex].ForcedPred = &Block; in mergeForcedPairs()
556 for (auto &Block : AllBlocks) { in mergeForcedPairs() local
557 if (Block.ForcedSucc == nullptr || Block.ForcedPred == nullptr) in mergeForcedPairs()
560 auto SuccBlock = Block.ForcedSucc; in mergeForcedPairs()
561 while (SuccBlock != nullptr && SuccBlock != &Block) { in mergeForcedPairs()
567 AllBlocks[Block.ForcedPred->Index].ForcedSucc = nullptr; in mergeForcedPairs()
568 Block.ForcedPred = nullptr; in mergeForcedPairs()
572 for (auto &Block : AllBlocks) { in mergeForcedPairs() local
573 if (Block.ForcedPred == nullptr && Block.ForcedSucc != nullptr) { in mergeForcedPairs()
574 auto CurBlock = &Block; in mergeForcedPairs()
577 mergeChains(Block.CurChain, NextBlock->CurChain, 0, MergeTypeTy::X_Y); in mergeForcedPairs()
663 MergedBlocks.forEach([&](const Block *BB) { in extTSPScore()
784 MergedChain mergeBlocks(const std::vector<Block *> &X, in mergeBlocks()
785 const std::vector<Block *> &Y, size_t MergeOffset, in mergeBlocks()
850 for (auto Block : Chain.blocks()) { in concatChains() local
851 Size += static_cast<double>(Block->Size); in concatChains()
852 ExecutionCount += static_cast<double>(Block->ExecutionCount); in concatChains()
877 for (auto Block : Chain->blocks()) { in concatChains() local
878 Order.push_back(Block->Index); in concatChains()
894 std::vector<Block> AllBlocks;