Lines Matching refs:BasicBlock
75 using BBValuePair = std::pair<BasicBlock *, Value *>;
78 using BBVector = SmallVector<BasicBlock *, 8>;
82 using BBSet = SmallPtrSet<BasicBlock *, 8>;
85 using BB2BBVecMap = MapVector<BasicBlock *, BBVector>;
87 using BBPhiMap = DenseMap<BasicBlock *, PhiMap>;
88 using BBPredicates = DenseMap<BasicBlock *, Value *>;
89 using PredMap = DenseMap<BasicBlock *, BBPredicates>;
90 using BB2BBMap = DenseMap<BasicBlock *, BasicBlock *>;
92 using BranchDebugLocMap = DenseMap<BasicBlock *, DebugLoc>;
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()
284 void delPhiValues(BasicBlock *From, BasicBlock *To);
286 void addPhiValues(BasicBlock *From, BasicBlock *To);
288 void findUndefBlocks(BasicBlock *PHIBlock,
289 const SmallSet<BasicBlock *, 8> &Incomings,
290 SmallVector<BasicBlock *> &UndefBlks) const;
295 void killTerminator(BasicBlock *BB);
297 void changeExit(RegionNode *Node, BasicBlock *NewExit,
300 BasicBlock *getNextFlow(BasicBlock *Dominator);
302 BasicBlock *needPrefix(bool NeedEmpty);
304 BasicBlock *needPostfix(BasicBlock *Flow, bool ExitUseAllowed);
306 void setPrevNode(BasicBlock *BB);
308 bool dominatesPredicates(BasicBlock *BB, RegionNode *Node);
312 void wireFlow(bool ExitUseAllowed, BasicBlock *LoopEnd);
314 void handleLoops(bool ExitUseAllowed, BasicBlock *LoopEnd);
436 BasicBlock *Exit = N->getNodeAs<Region>()->getExit(); in analyzeLoops()
442 BasicBlock *BB = N->getNodeAs<BasicBlock>(); in analyzeLoops()
445 for (BasicBlock *Succ : Term->successors()) in analyzeLoops()
467 BasicBlock *BB = N->getEntry(); in gatherPredicates()
471 for (BasicBlock *P : predecessors(BB)) { in gatherPredicates()
481 BasicBlock *Succ = Term->getSuccessor(i); in gatherPredicates()
489 BasicBlock *Other = Term->getSuccessor(!i); in gatherPredicates()
513 BasicBlock *Entry = R->getEntry(); in gatherPredicates()
552 for (BasicBlock &BB : *Func) { in collectInfos()
567 BasicBlock *Parent = Term->getParent(); in insertConditions()
568 BasicBlock *SuccTrue = Term->getSuccessor(0); in insertConditions()
569 BasicBlock *SuccFalse = Term->getSuccessor(1); in insertConditions()
581 for (std::pair<BasicBlock *, Value *> BBAndPred : Preds) { in insertConditions()
582 BasicBlock *BB = BBAndPred.first; in insertConditions()
628 void StructurizeCFG::delPhiValues(BasicBlock *From, BasicBlock *To) { in delPhiValues()
644 void StructurizeCFG::addPhiValues(BasicBlock *From, BasicBlock *To) { in addPhiValues()
657 BasicBlock *PHIBlock, const SmallSet<BasicBlock *, 8> &Incomings, in findUndefBlocks() argument
658 SmallVector<BasicBlock *> &UndefBlks) const { in findUndefBlocks()
683 SmallSet<BasicBlock *, 8> VisitedBlock; in findUndefBlocks()
684 SmallVector<BasicBlock *, 8> Stack; in findUndefBlocks()
699 BasicBlock *Current = Stack.pop_back_val(); in findUndefBlocks()
718 BasicBlock *To = AddedPhi.first; in setPhiValues()
724 SmallVector<BasicBlock *> UndefBlks; in setPhiValues()
734 SmallSet<BasicBlock *, 8> Incomings; in setPhiValues()
735 SmallVector<BasicBlock *> ConstantPreds; in setPhiValues()
754 [&](BasicBlock *CP) { return DT->dominates(CP, UB); })) in setPhiValues()
759 for (BasicBlock *FI : From) in setPhiValues()
793 void StructurizeCFG::killTerminator(BasicBlock *BB) { in killTerminator()
798 for (BasicBlock *Succ : successors(BB)) in killTerminator()
805 void StructurizeCFG::changeExit(RegionNode *Node, BasicBlock *NewExit, in changeExit()
809 BasicBlock *OldExit = SubRegion->getExit(); in changeExit()
810 BasicBlock *Dominator = nullptr; in changeExit()
814 for (BasicBlock *BB : llvm::make_early_inc_range(predecessors(OldExit))) { in changeExit()
839 BasicBlock *BB = Node->getNodeAs<BasicBlock>(); in changeExit()
850 BasicBlock *StructurizeCFG::getNextFlow(BasicBlock *Dominator) { in getNextFlow()
852 BasicBlock *Insert = Order.empty() ? ParentRegion->getExit() : in getNextFlow()
854 BasicBlock *Flow = BasicBlock::Create(Context, FlowBlockName, in getNextFlow()
869 BasicBlock *StructurizeCFG::needPrefix(bool NeedEmpty) { in needPrefix()
870 BasicBlock *Entry = PrevNode->getEntry(); in needPrefix()
879 BasicBlock *Flow = getNextFlow(Entry); in needPrefix()
888 BasicBlock *StructurizeCFG::needPostfix(BasicBlock *Flow, in needPostfix()
893 BasicBlock *Exit = ParentRegion->getExit(); in needPostfix()
900 void StructurizeCFG::setPrevNode(BasicBlock *BB) { in setPrevNode()
906 bool StructurizeCFG::dominatesPredicates(BasicBlock *BB, RegionNode *Node) { in dominatesPredicates()
908 return llvm::all_of(Preds, [&](std::pair<BasicBlock *, Value *> Pred) { in dominatesPredicates() argument
922 for (std::pair<BasicBlock*, Value*> Pred : Preds) { in isPredictableTrue()
923 BasicBlock *BB = Pred.first; in isPredictableTrue()
939 BasicBlock *LoopEnd) { in wireFlow()
951 BasicBlock *Flow = needPrefix(false); in wireFlow()
954 BasicBlock *Entry = Node->getEntry(); in wireFlow()
955 BasicBlock *Next = needPostfix(Flow, ExitUseAllowed); in wireFlow()
976 BasicBlock *LoopEnd) { in handleLoops()
978 BasicBlock *LoopStart = Node->getEntry(); in handleLoops()
998 BasicBlock *Next = needPostfix(LoopEnd, ExitUseAllowed); in handleLoops()
1009 BasicBlock *Exit = ParentRegion->getExit(); in createFlow()
1035 for (BasicBlock *BB : ParentRegion->blocks()) in rebuildSSA()