Lines Matching refs:BasicBlock
73 using BBValuePair = std::pair<BasicBlock *, Value *>;
76 using BBVector = SmallVector<BasicBlock *, 8>;
80 using BBSet = SmallPtrSet<BasicBlock *, 8>;
83 using BB2BBVecMap = MapVector<BasicBlock *, BBVector>;
85 using BBPhiMap = DenseMap<BasicBlock *, PhiMap>;
86 using BBPredicates = DenseMap<BasicBlock *, Value *>;
87 using PredMap = DenseMap<BasicBlock *, BBPredicates>;
88 using BB2BBMap = DenseMap<BasicBlock *, BasicBlock *>;
150 BasicBlock *Result = nullptr;
154 void addBlock(BasicBlock *BB, bool Remember) { in addBlock()
161 BasicBlock *NewResult = DT->findNearestCommonDominator(Result, BB); in addBlock()
172 void addBlock(BasicBlock *BB) { in addBlock()
176 void addAndRememberBlock(BasicBlock *BB) { in addAndRememberBlock()
182 BasicBlock *result() { return Result; } in result()
277 void delPhiValues(BasicBlock *From, BasicBlock *To);
279 void addPhiValues(BasicBlock *From, BasicBlock *To);
285 void killTerminator(BasicBlock *BB);
287 void changeExit(RegionNode *Node, BasicBlock *NewExit,
290 BasicBlock *getNextFlow(BasicBlock *Dominator);
292 BasicBlock *needPrefix(bool NeedEmpty);
294 BasicBlock *needPostfix(BasicBlock *Flow, bool ExitUseAllowed);
296 void setPrevNode(BasicBlock *BB);
298 bool dominatesPredicates(BasicBlock *BB, RegionNode *Node);
302 void wireFlow(bool ExitUseAllowed, BasicBlock *LoopEnd);
304 void handleLoops(bool ExitUseAllowed, BasicBlock *LoopEnd);
427 BasicBlock *Exit = N->getNodeAs<Region>()->getExit(); in analyzeLoops()
433 BasicBlock *BB = N->getNodeAs<BasicBlock>(); in analyzeLoops()
436 for (BasicBlock *Succ : Term->successors()) in analyzeLoops()
458 BasicBlock *BB = N->getEntry(); in gatherPredicates()
462 for (BasicBlock *P : predecessors(BB)) { in gatherPredicates()
472 BasicBlock *Succ = Term->getSuccessor(i); in gatherPredicates()
480 BasicBlock *Other = Term->getSuccessor(!i); in gatherPredicates()
504 BasicBlock *Entry = R->getEntry(); in gatherPredicates()
550 BasicBlock *Parent = Term->getParent(); in insertConditions()
551 BasicBlock *SuccTrue = Term->getSuccessor(0); in insertConditions()
552 BasicBlock *SuccFalse = Term->getSuccessor(1); in insertConditions()
564 for (std::pair<BasicBlock *, Value *> BBAndPred : Preds) { in insertConditions()
565 BasicBlock *BB = BBAndPred.first; in insertConditions()
611 void StructurizeCFG::delPhiValues(BasicBlock *From, BasicBlock *To) { in delPhiValues()
627 void StructurizeCFG::addPhiValues(BasicBlock *From, BasicBlock *To) { in addPhiValues()
640 BasicBlock *To = AddedPhi.first; in setPhiValues()
664 for (BasicBlock *FI : From) in setPhiValues()
695 void StructurizeCFG::killTerminator(BasicBlock *BB) { in killTerminator()
700 for (BasicBlock *Succ : successors(BB)) in killTerminator()
709 void StructurizeCFG::changeExit(RegionNode *Node, BasicBlock *NewExit, in changeExit()
713 BasicBlock *OldExit = SubRegion->getExit(); in changeExit()
714 BasicBlock *Dominator = nullptr; in changeExit()
718 for (BasicBlock *BB : llvm::make_early_inc_range(predecessors(OldExit))) { in changeExit()
743 BasicBlock *BB = Node->getNodeAs<BasicBlock>(); in changeExit()
753 BasicBlock *StructurizeCFG::getNextFlow(BasicBlock *Dominator) { in getNextFlow()
755 BasicBlock *Insert = Order.empty() ? ParentRegion->getExit() : in getNextFlow()
757 BasicBlock *Flow = BasicBlock::Create(Context, FlowBlockName, in getNextFlow()
765 BasicBlock *StructurizeCFG::needPrefix(bool NeedEmpty) { in needPrefix()
766 BasicBlock *Entry = PrevNode->getEntry(); in needPrefix()
775 BasicBlock *Flow = getNextFlow(Entry); in needPrefix()
784 BasicBlock *StructurizeCFG::needPostfix(BasicBlock *Flow, in needPostfix()
789 BasicBlock *Exit = ParentRegion->getExit(); in needPostfix()
796 void StructurizeCFG::setPrevNode(BasicBlock *BB) { in setPrevNode()
802 bool StructurizeCFG::dominatesPredicates(BasicBlock *BB, RegionNode *Node) { in dominatesPredicates()
804 return llvm::all_of(Preds, [&](std::pair<BasicBlock *, Value *> Pred) { in dominatesPredicates() argument
818 for (std::pair<BasicBlock*, Value*> Pred : Preds) { in isPredictableTrue()
819 BasicBlock *BB = Pred.first; in isPredictableTrue()
835 BasicBlock *LoopEnd) { in wireFlow()
847 BasicBlock *Flow = needPrefix(false); in wireFlow()
850 BasicBlock *Entry = Node->getEntry(); in wireFlow()
851 BasicBlock *Next = needPostfix(Flow, ExitUseAllowed); in wireFlow()
870 BasicBlock *LoopEnd) { in handleLoops()
872 BasicBlock *LoopStart = Node->getEntry(); in handleLoops()
894 BasicBlock *NewEntry = in handleLoops()
895 BasicBlock::Create(LoopStart->getContext(), in handleLoops()
905 BasicBlock *Next = needPostfix(LoopEnd, ExitUseAllowed); in handleLoops()
915 BasicBlock *Exit = ParentRegion->getExit(); in createFlow()
941 for (BasicBlock *BB : ParentRegion->blocks()) in rebuildSSA()