Lines Matching refs:BasicBlock
68 using BBValuePair = std::pair<BasicBlock *, Value *>;
71 using BBVector = SmallVector<BasicBlock *, 8>;
75 using BBSet = SmallPtrSet<BasicBlock *, 8>;
78 using BB2BBVecMap = MapVector<BasicBlock *, BBVector>;
80 using BBPhiMap = DenseMap<BasicBlock *, PhiMap>;
81 using BBPredicates = DenseMap<BasicBlock *, Value *>;
82 using PredMap = DenseMap<BasicBlock *, BBPredicates>;
83 using BB2BBMap = DenseMap<BasicBlock *, BasicBlock *>;
92 BasicBlock *Result = nullptr;
96 void addBlock(BasicBlock *BB, bool Remember) { in addBlock()
103 BasicBlock *NewResult = DT->findNearestCommonDominator(Result, BB); in addBlock()
114 void addBlock(BasicBlock *BB) { in addBlock()
118 void addAndRememberBlock(BasicBlock *BB) { in addAndRememberBlock()
124 BasicBlock *result() { return Result; } in result()
223 void delPhiValues(BasicBlock *From, BasicBlock *To);
225 void addPhiValues(BasicBlock *From, BasicBlock *To);
229 void killTerminator(BasicBlock *BB);
231 void changeExit(RegionNode *Node, BasicBlock *NewExit,
234 BasicBlock *getNextFlow(BasicBlock *Dominator);
236 BasicBlock *needPrefix(bool NeedEmpty);
238 BasicBlock *needPostfix(BasicBlock *Flow, bool ExitUseAllowed);
240 void setPrevNode(BasicBlock *BB);
242 bool dominatesPredicates(BasicBlock *BB, RegionNode *Node);
246 void wireFlow(bool ExitUseAllowed, BasicBlock *LoopEnd);
248 void handleLoops(bool ExitUseAllowed, BasicBlock *LoopEnd);
383 BasicBlock *Exit = N->getNodeAs<Region>()->getExit(); in analyzeLoops()
389 BasicBlock *BB = N->getNodeAs<BasicBlock>(); in analyzeLoops()
392 for (BasicBlock *Succ : Term->successors()) in analyzeLoops()
411 BasicBlock *Parent = Inst->getParent(); in invert()
422 BasicBlock &EntryBlock = Arg->getParent()->getEntryBlock(); in invert()
447 BasicBlock *BB = N->getEntry(); in gatherPredicates()
451 for (BasicBlock *P : predecessors(BB)) { in gatherPredicates()
461 BasicBlock *Succ = Term->getSuccessor(i); in gatherPredicates()
469 BasicBlock *Other = Term->getSuccessor(!i); in gatherPredicates()
493 BasicBlock *Entry = R->getEntry(); in gatherPredicates()
540 BasicBlock *Parent = Term->getParent(); in insertConditions()
541 BasicBlock *SuccTrue = Term->getSuccessor(0); in insertConditions()
542 BasicBlock *SuccFalse = Term->getSuccessor(1); in insertConditions()
554 for (std::pair<BasicBlock *, Value *> BBAndPred : Preds) { in insertConditions()
555 BasicBlock *BB = BBAndPred.first; in insertConditions()
579 void StructurizeCFG::delPhiValues(BasicBlock *From, BasicBlock *To) { in delPhiValues()
590 void StructurizeCFG::addPhiValues(BasicBlock *From, BasicBlock *To) { in addPhiValues()
603 BasicBlock *To = AddedPhi.first; in setPhiValues()
627 for (BasicBlock *FI : From) { in setPhiValues()
660 void StructurizeCFG::killTerminator(BasicBlock *BB) { in killTerminator()
675 void StructurizeCFG::changeExit(RegionNode *Node, BasicBlock *NewExit, in changeExit()
679 BasicBlock *OldExit = SubRegion->getExit(); in changeExit()
680 BasicBlock *Dominator = nullptr; in changeExit()
685 BasicBlock *BB = *BBI++; in changeExit()
711 BasicBlock *BB = Node->getNodeAs<BasicBlock>(); in changeExit()
721 BasicBlock *StructurizeCFG::getNextFlow(BasicBlock *Dominator) { in getNextFlow()
723 BasicBlock *Insert = Order.empty() ? ParentRegion->getExit() : in getNextFlow()
725 BasicBlock *Flow = BasicBlock::Create(Context, FlowBlockName, in getNextFlow()
733 BasicBlock *StructurizeCFG::needPrefix(bool NeedEmpty) { in needPrefix()
734 BasicBlock *Entry = PrevNode->getEntry(); in needPrefix()
743 BasicBlock *Flow = getNextFlow(Entry); in needPrefix()
752 BasicBlock *StructurizeCFG::needPostfix(BasicBlock *Flow, in needPostfix()
757 BasicBlock *Exit = ParentRegion->getExit(); in needPostfix()
764 void StructurizeCFG::setPrevNode(BasicBlock *BB) { in setPrevNode()
770 bool StructurizeCFG::dominatesPredicates(BasicBlock *BB, RegionNode *Node) { in dominatesPredicates()
772 return llvm::all_of(Preds, [&](std::pair<BasicBlock *, Value *> Pred) { in dominatesPredicates() argument
786 for (std::pair<BasicBlock*, Value*> Pred : Preds) { in isPredictableTrue()
787 BasicBlock *BB = Pred.first; in isPredictableTrue()
803 BasicBlock *LoopEnd) { in wireFlow()
815 BasicBlock *Flow = needPrefix(false); in wireFlow()
818 BasicBlock *Entry = Node->getEntry(); in wireFlow()
819 BasicBlock *Next = needPostfix(Flow, ExitUseAllowed); in wireFlow()
838 BasicBlock *LoopEnd) { in handleLoops()
840 BasicBlock *LoopStart = Node->getEntry(); in handleLoops()
862 BasicBlock *NewEntry = in handleLoops()
863 BasicBlock::Create(LoopStart->getContext(), in handleLoops()
873 BasicBlock *Next = needPostfix(LoopEnd, ExitUseAllowed); in handleLoops()
883 BasicBlock *Exit = ParentRegion->getExit(); in createFlow()
908 for (BasicBlock *BB : ParentRegion->blocks()) in rebuildSSA()