Lines Matching full:basicblock
77 BasicBlock *Dest;
79 ValueEqualityComparisonCase(ConstantInt *Value, BasicBlock *Dest)
87 bool operator==(BasicBlock *RHSDest) const { return Dest == RHSDest; }
94 BasicBlock *GetValueEqualityComparisonCases(TerminatorInst *TI,
97 BasicBlock *Pred,
113 bool run(BasicBlock *BB);
126 BasicBlock *SI1BB = SI1->getParent();
127 BasicBlock *SI2BB = SI2->getParent();
128 SmallPtrSet<BasicBlock*, 16> SI1Succs(succ_begin(SI1BB), succ_end(SI1BB));
132 for (BasicBlock::iterator BBI = (*I)->begin();
168 BasicBlock *SI1BB = SI1->getParent();
169 BasicBlock *SI2BB = SI2->getParent();
170 SmallPtrSet<BasicBlock*, 16> SI1Succs(succ_begin(SI1BB), succ_end(SI1BB));
173 for (BasicBlock::iterator BBI = (*I)->begin();
188 static void AddPredecessorToBlock(BasicBlock *Succ, BasicBlock *NewPred,
189 BasicBlock *ExistPred) {
193 for (BasicBlock::iterator I = Succ->begin();
251 static bool DominatesMergePoint(Value *V, BasicBlock *BB,
263 BasicBlock *PBB = I->getParent();
486 BasicBlock *SimplifyCFGOpt::
500 BasicBlock *Succ = BI->getSuccessor(ICI->getPredicate() == ICmpInst::ICMP_NE);
510 static void EliminateBlockCases(BasicBlock *BB,
558 BasicBlock *Pred,
572 BasicBlock *PredDef = GetValueEqualityComparisonCases(Pred->getTerminator(),
578 BasicBlock *ThisDef = GetValueEqualityComparisonCases(TI, ThisCases);
651 BasicBlock *TIBB = TI->getParent();
662 BasicBlock *TheRealDest = 0;
673 BasicBlock *CheckEdge = TheRealDest;
768 BasicBlock *BB = TI->getParent();
773 SmallVector<BasicBlock*, 16> Preds(pred_begin(BB), pred_end(BB));
775 BasicBlock *Pred = Preds.pop_back_val();
784 BasicBlock *BBDefault = GetValueEqualityComparisonCases(TI, BBCases);
787 BasicBlock *PredDefault = GetValueEqualityComparisonCases(PTI, PredCases);
792 SmallVector<BasicBlock*, 8> NewSuccessors;
954 BasicBlock *InfLoopBlock = 0;
960 InfLoopBlock = BasicBlock::Create(BB->getContext(),
977 static bool isSafeToHoistInvoke(BasicBlock *BB1, BasicBlock *BB2,
981 for (BasicBlock::iterator BBI = SI->begin();
1002 BasicBlock *BB1 = BI->getSuccessor(0); // The true destination.
1003 BasicBlock *BB2 = BI->getSuccessor(1); // The false destination
1005 BasicBlock::iterator BB1_Itr = BB1->begin();
1006 BasicBlock::iterator BB2_Itr = BB2->begin();
1022 BasicBlock *BIParent = BI->getParent();
1063 for (BasicBlock::iterator BBI = SI->begin();
1094 for (BasicBlock::iterator BBI = SI->begin();
1129 BasicBlock *BB1 = BI1->getParent();
1130 BasicBlock *BBEnd = BI1->getSuccessor(0);
1135 BasicBlock *Pred0 = *PI++;
1138 BasicBlock *Pred1 = *PI++;
1141 BasicBlock *BB2 = (Pred0 == BB1) ? Pred1 : Pred0;
1149 for (BasicBlock::iterator I = BBEnd->begin(), E = BBEnd->end();
1167 BasicBlock::InstListType::reverse_iterator RI1 = BB1->getInstList().rbegin(),
1318 static Value *isSafeToSpeculateStore(Instruction *I, BasicBlock *BrBB,
1319 BasicBlock *StoreBB, BasicBlock *EndBB) {
1332 for (BasicBlock::reverse_iterator RI = BrBB->rbegin(),
1389 static bool SpeculativelyExecuteBB(BranchInst *BI, BasicBlock *ThenBB) {
1395 BasicBlock *BB = BI->getParent();
1396 BasicBlock *EndBB = ThenBB->getTerminator()->getSuccessor(0);
1417 for (BasicBlock::iterator BBI = ThenBB->begin(),
1473 for (BasicBlock::iterator I = EndBB->begin();
1532 for (BasicBlock::iterator I = EndBB->begin();
1561 static bool BlockIsSimpleEnoughToThreadThrough(BasicBlock *BB) {
1565 for (BasicBlock::iterator BBI = BB->begin(); &*BBI != BI; ++BBI) {
1590 BasicBlock *BB = BI->getParent();
1614 BasicBlock *PredBB = PN->getIncomingBlock(i);
1615 BasicBlock *RealDest = BI->getSuccessor(!CB->getZExtValue());
1625 BasicBlock *EdgeBB = BasicBlock::Create(BB->getContext(),
1636 BasicBlock::iterator InsertPt = EdgeBB->begin();
1638 for (BasicBlock::iterator BBI = BB->begin(); &*BBI != BI; ++BBI) {
1692 BasicBlock *BB = PN->getParent();
1693 BasicBlock *IfTrue, *IfFalse;
1706 for (BasicBlock::iterator I = BB->begin(); isa<PHINode>(I); ++NumPhis, ++I)
1717 for (BasicBlock::iterator II = BB->begin(); isa<PHINode>(II);) {
1749 BasicBlock *DomBlock = 0;
1750 BasicBlock *IfBlock1 = PN->getIncomingBlock(0);
1751 BasicBlock *IfBlock2 = PN->getIncomingBlock(1);
1756 for (BasicBlock::iterator I = IfBlock1->begin();!isa<TerminatorInst>(I);++I)
1769 for (BasicBlock::iterator I = IfBlock2->begin();!isa<TerminatorInst>(I);++I)
1825 BasicBlock *TrueSucc = BI->getSuccessor(0);
1826 BasicBlock *FalseSucc = BI->getSuccessor(1);
1928 static bool checkCSEInPredecessor(Instruction *Inst, BasicBlock *PB) {
1931 for (BasicBlock::iterator I = PB->begin(), E = PB->end(); I != E; I++) {
1947 BasicBlock *BB = BI->getParent();
1957 if (BasicBlock *PB = BB->getSinglePredecessor())
1962 for (BasicBlock::iterator I = BB->begin(), E = BB->end();
1986 BasicBlock::iterator FrontIt = BB->front();
2011 BasicBlock::iterator CondIt = Cond; ++CondIt;
2029 BasicBlock *TrueDest = BI->getSuccessor(0);
2030 BasicBlock *FalseDest = (BI->isConditional()) ? BI->getSuccessor(1) : 0;
2035 BasicBlock *PredBlock = *PI;
2251 for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I)
2266 BasicBlock *BB = BI->getParent();
2296 BasicBlock *P = *PI;
2317 BasicBlock::iterator BBI = BB->begin();
2350 BasicBlock *CommonDest = PBI->getSuccessor(PBIOp);
2353 for (BasicBlock::iterator II = CommonDest->begin();
2359 BasicBlock *OtherDest = BI->getSuccessor(BIOp ^ 1);
2375 BasicBlock *InfLoopBlock = BasicBlock::Create(BB->getContext(),
2440 for (BasicBlock::iterator II = CommonDest->begin();
2467 BasicBlock *TrueBB, BasicBlock *FalseBB,
2474 BasicBlock *KeepEdge1 = TrueBB;
2475 BasicBlock *KeepEdge2 = TrueBB != FalseBB ? FalseBB : 0;
2479 BasicBlock *Succ = OldTerm->getSuccessor(I);
2540 BasicBlock *TrueBB = SI->findCaseValue(TrueVal).getCaseSuccessor();
2541 BasicBlock *FalseBB = SI->findCaseValue(FalseVal).getCaseSuccessor();
2575 BasicBlock *TrueBB = TBA->getBasicBlock();
2576 BasicBlock *FalseBB = FBA->getBasicBlock();
2603 BasicBlock *BB = ICI->getParent();
2615 BasicBlock *Pred = BB->getSinglePredecessor();
2656 BasicBlock *SuccBlock = BB->getTerminator()->getSuccessor(0);
2659 isa<PHINode>(++BasicBlock::iterator(PHIUse)))
2677 BasicBlock *NewBB = BasicBlock::Create(BB->getContext(), "switch.edge",
2751 BasicBlock *DefaultBB = BI->getSuccessor(1);
2752 BasicBlock *EdgeBB = BI->getSuccessor(0);
2755 BasicBlock *BB = BI->getParent();
2764 BasicBlock *NewBB = BB->splitBasicBlock(BI, "switch.early.test");
2804 for (BasicBlock::iterator BBI = EdgeBB->begin();
2822 BasicBlock *BB = RI->getParent();
2830 BasicBlock::iterator I = LPInst, E = RI;
2880 BasicBlock *BB = RI->getParent();
2884 BasicBlock*, 8> UncondBranchPreds;
2887 BasicBlock *P = *PI;
2900 BasicBlock *Pred = UncondBranchPreds.pop_back_val();
2930 BasicBlock *BB = UI->getParent();
2937 BasicBlock::iterator BBI = UI;
2978 SmallVector<BasicBlock*, 8> Preds(pred_begin(BB), pred_end(BB));
3011 std::map<BasicBlock*, std::pair<unsigned, unsigned> > Popularity;
3027 BasicBlock *MaxBlock = 0;
3028 for (std::map<BasicBlock*, std::pair<unsigned, unsigned> >::iterator
3149 for (BasicBlock::iterator BBI = SI->case_begin().getCaseSuccessor()->begin();
3215 BasicBlock *BB,
3226 BasicBlock *Succ = Branch->getSuccessor(0);
3228 BasicBlock::iterator I = Succ->begin();
3253 BasicBlock *CaseDest = I.getCaseSuccessor();
3356 BasicBlock *CaseDest,
3357 BasicBlock **CommonDest,
3360 BasicBlock *Pred = SI->getParent();
3366 for (BasicBlock::iterator I = CaseDest->begin(), E = CaseDest->end(); I != E;
3393 BasicBlock::iterator I = (*CommonDest)->begin();
3683 BasicBlock *CommonDest = 0;
3731 BasicBlock *LookupBB = BasicBlock::Create(Mod.getContext(),
3773 BasicBlock *Succ = SI->getSuccessor(i);
3784 BasicBlock *BB = SI->getParent();
3789 if (BasicBlock *OnlyPred = BB->getSinglePredecessor())
3800 BasicBlock::iterator BBI = BB->begin();
3827 BasicBlock *BB = IBI->getParent();
3833 BasicBlock *Dest = IBI->getDestination(i);
3864 BasicBlock *BB = BI->getParent();
3870 BasicBlock::iterator I = BB->getFirstNonPHIOrDbgOrLifetime();
3897 BasicBlock *BB = BI->getParent();
3904 if (BasicBlock *OnlyPred = BB->getSinglePredecessor())
3910 BasicBlock::iterator I = BB->begin();
3996 for (BasicBlock::iterator i = ++BasicBlock::iterator(I); &*i != Use; ++i)
4024 static bool removeUndefIntroducingPredecessor(BasicBlock *BB) {
4025 for (BasicBlock::iterator i = BB->begin();
4049 bool SimplifyCFGOpt::run(BasicBlock *BB) {
4119 bool llvm::SimplifyCFG(BasicBlock *BB, const TargetTransformInfo &TTI,