Lines Matching refs:BasicBlock

77 using BBValuePair = std::pair<BasicBlock *, Value *>;
80 using BBVector = SmallVector<BasicBlock *, 8>;
84 using BBSet = SmallPtrSet<BasicBlock *, 8>;
87 using BB2BBVecMap = MapVector<BasicBlock *, BBVector>;
89 using BBPhiMap = DenseMap<BasicBlock *, PhiMap>;
90 using BBPredicates = DenseMap<BasicBlock *, Value *>;
91 using PredMap = DenseMap<BasicBlock *, BBPredicates>;
92 using BB2BBMap = DenseMap<BasicBlock *, BasicBlock *>;
154 BasicBlock *Result = nullptr;
158 void addBlock(BasicBlock *BB, bool Remember) { in addBlock()
165 BasicBlock *NewResult = DT->findNearestCommonDominator(Result, BB); in addBlock()
176 void addBlock(BasicBlock *BB) { in addBlock()
180 void addAndRememberBlock(BasicBlock *BB) { in addAndRememberBlock()
186 BasicBlock *result() { return Result; } in result()
279 void delPhiValues(BasicBlock *From, BasicBlock *To);
281 void addPhiValues(BasicBlock *From, BasicBlock *To);
287 void killTerminator(BasicBlock *BB);
289 void changeExit(RegionNode *Node, BasicBlock *NewExit,
292 BasicBlock *getNextFlow(BasicBlock *Dominator);
294 BasicBlock *needPrefix(bool NeedEmpty);
296 BasicBlock *needPostfix(BasicBlock *Flow, bool ExitUseAllowed);
298 void setPrevNode(BasicBlock *BB);
300 bool dominatesPredicates(BasicBlock *BB, RegionNode *Node);
304 void wireFlow(bool ExitUseAllowed, BasicBlock *LoopEnd);
306 void handleLoops(bool ExitUseAllowed, BasicBlock *LoopEnd);
429 BasicBlock *Exit = N->getNodeAs<Region>()->getExit(); in analyzeLoops()
435 BasicBlock *BB = N->getNodeAs<BasicBlock>(); in analyzeLoops()
438 for (BasicBlock *Succ : Term->successors()) in analyzeLoops()
460 BasicBlock *BB = N->getEntry(); in gatherPredicates()
464 for (BasicBlock *P : predecessors(BB)) { in gatherPredicates()
474 BasicBlock *Succ = Term->getSuccessor(i); in gatherPredicates()
482 BasicBlock *Other = Term->getSuccessor(!i); in gatherPredicates()
506 BasicBlock *Entry = R->getEntry(); in gatherPredicates()
552 BasicBlock *Parent = Term->getParent(); in insertConditions()
553 BasicBlock *SuccTrue = Term->getSuccessor(0); in insertConditions()
554 BasicBlock *SuccFalse = Term->getSuccessor(1); in insertConditions()
566 for (std::pair<BasicBlock *, Value *> BBAndPred : Preds) { in insertConditions()
567 BasicBlock *BB = BBAndPred.first; in insertConditions()
591 void StructurizeCFG::delPhiValues(BasicBlock *From, BasicBlock *To) { in delPhiValues()
607 void StructurizeCFG::addPhiValues(BasicBlock *From, BasicBlock *To) { in addPhiValues()
620 BasicBlock *To = AddedPhi.first; in setPhiValues()
644 for (BasicBlock *FI : From) in setPhiValues()
675 void StructurizeCFG::killTerminator(BasicBlock *BB) { in killTerminator()
680 for (BasicBlock *Succ : successors(BB)) in killTerminator()
689 void StructurizeCFG::changeExit(RegionNode *Node, BasicBlock *NewExit, in changeExit()
693 BasicBlock *OldExit = SubRegion->getExit(); in changeExit()
694 BasicBlock *Dominator = nullptr; in changeExit()
698 for (BasicBlock *BB : llvm::make_early_inc_range(predecessors(OldExit))) { in changeExit()
723 BasicBlock *BB = Node->getNodeAs<BasicBlock>(); in changeExit()
733 BasicBlock *StructurizeCFG::getNextFlow(BasicBlock *Dominator) { in getNextFlow()
735 BasicBlock *Insert = Order.empty() ? ParentRegion->getExit() : in getNextFlow()
737 BasicBlock *Flow = BasicBlock::Create(Context, FlowBlockName, in getNextFlow()
745 BasicBlock *StructurizeCFG::needPrefix(bool NeedEmpty) { in needPrefix()
746 BasicBlock *Entry = PrevNode->getEntry(); in needPrefix()
755 BasicBlock *Flow = getNextFlow(Entry); in needPrefix()
764 BasicBlock *StructurizeCFG::needPostfix(BasicBlock *Flow, in needPostfix()
769 BasicBlock *Exit = ParentRegion->getExit(); in needPostfix()
776 void StructurizeCFG::setPrevNode(BasicBlock *BB) { in setPrevNode()
782 bool StructurizeCFG::dominatesPredicates(BasicBlock *BB, RegionNode *Node) { in dominatesPredicates()
784 return llvm::all_of(Preds, [&](std::pair<BasicBlock *, Value *> Pred) { in dominatesPredicates() argument
798 for (std::pair<BasicBlock*, Value*> Pred : Preds) { in isPredictableTrue()
799 BasicBlock *BB = Pred.first; in isPredictableTrue()
815 BasicBlock *LoopEnd) { in wireFlow()
827 BasicBlock *Flow = needPrefix(false); in wireFlow()
830 BasicBlock *Entry = Node->getEntry(); in wireFlow()
831 BasicBlock *Next = needPostfix(Flow, ExitUseAllowed); in wireFlow()
850 BasicBlock *LoopEnd) { in handleLoops()
852 BasicBlock *LoopStart = Node->getEntry(); in handleLoops()
874 BasicBlock *NewEntry = in handleLoops()
875 BasicBlock::Create(LoopStart->getContext(), in handleLoops()
885 BasicBlock *Next = needPostfix(LoopEnd, ExitUseAllowed); in handleLoops()
895 BasicBlock *Exit = ParentRegion->getExit(); in createFlow()
921 for (BasicBlock *BB : ParentRegion->blocks()) in rebuildSSA()