Lines Matching refs:TrueBBI
227 bool ValidSimple(BBInfo &TrueBBI, unsigned &Dups,
229 bool ValidTriangle(BBInfo &TrueBBI, BBInfo &FalseBBI,
238 bool ValidDiamond(BBInfo &TrueBBI, BBInfo &FalseBBI,
241 bool ValidForkedDiamond(BBInfo &TrueBBI, BBInfo &FalseBBI,
252 BBInfo &TrueBBI, BBInfo &FalseBBI) const;
263 bool IfConvertDiamondCommon(BBInfo &BBI, BBInfo &TrueBBI, BBInfo &FalseBBI,
643 bool IfConverter::ValidSimple(BBInfo &TrueBBI, unsigned &Dups, in ValidSimple() argument
646 if (TrueBBI.IsBeingAnalyzed || TrueBBI.IsDone) in ValidSimple()
649 if (TrueBBI.IsBrAnalyzable) in ValidSimple()
652 if (TrueBBI.BB->pred_size() > 1) { in ValidSimple()
653 if (TrueBBI.CannotBeCopied || in ValidSimple()
654 !TII->isProfitableToDupForIfCvt(*TrueBBI.BB, TrueBBI.NonPredSize, in ValidSimple()
657 Dups = TrueBBI.NonPredSize; in ValidSimple()
668 bool IfConverter::ValidTriangle(BBInfo &TrueBBI, BBInfo &FalseBBI, in ValidTriangle() argument
672 if (TrueBBI.BB == FalseBBI.BB) in ValidTriangle()
675 if (TrueBBI.IsBeingAnalyzed || TrueBBI.IsDone) in ValidTriangle()
678 if (TrueBBI.BB->pred_size() > 1) { in ValidTriangle()
679 if (TrueBBI.CannotBeCopied) in ValidTriangle()
682 unsigned Size = TrueBBI.NonPredSize; in ValidTriangle()
683 if (TrueBBI.IsBrAnalyzable) { in ValidTriangle()
684 if (TrueBBI.TrueBB && TrueBBI.BrCond.empty()) in ValidTriangle()
689 ? TrueBBI.TrueBB : TrueBBI.FalseBB; in ValidTriangle()
695 if (!TII->isProfitableToDupForIfCvt(*TrueBBI.BB, Size, Prediction)) in ValidTriangle()
700 MachineBasicBlock *TExit = FalseBranch ? TrueBBI.FalseBB : TrueBBI.TrueBB; in ValidTriangle()
701 if (!TExit && blockAlwaysFallThrough(TrueBBI)) { in ValidTriangle()
702 MachineFunction::iterator I = TrueBBI.BB->getIterator(); in ValidTriangle()
703 if (++I == TrueBBI.BB->getParent()->end()) in ValidTriangle()
813 BBInfo &TrueBBI, BBInfo &FalseBBI) const { in RescanInstructions() argument
815 TrueBBI.IsUnpredicable = FalseBBI.IsUnpredicable = false; in RescanInstructions()
816 ScanInstructions(TrueBBI, TIB, TIE, BranchUnpredicable); in RescanInstructions()
817 if (TrueBBI.IsUnpredicable) in RescanInstructions()
822 if (TrueBBI.ClobbersPred && FalseBBI.ClobbersPred) in RescanInstructions()
875 BBInfo &TrueBBI, BBInfo &FalseBBI, in ValidForkedDiamond() argument
879 if (TrueBBI.IsBeingAnalyzed || TrueBBI.IsDone || in ValidForkedDiamond()
883 if (!TrueBBI.IsBrAnalyzable || !FalseBBI.IsBrAnalyzable) in ValidForkedDiamond()
886 if (TrueBBI.BB->pred_size() > 1 || FalseBBI.BB->pred_size() > 1) in ValidForkedDiamond()
891 if (TrueBBI.BrCond.size() == 0 || in ValidForkedDiamond()
895 MachineBasicBlock *TT = TrueBBI.TrueBB; in ValidForkedDiamond()
896 MachineBasicBlock *TF = TrueBBI.FalseBB; in ValidForkedDiamond()
901 TT = getNextBlock(*TrueBBI.BB); in ValidForkedDiamond()
903 TF = getNextBlock(*TrueBBI.BB); in ValidForkedDiamond()
930 MachineBasicBlock::iterator TIB = TrueBBI.BB->begin(); in ValidForkedDiamond()
932 MachineBasicBlock::iterator TIE = TrueBBI.BB->end(); in ValidForkedDiamond()
935 *TrueBBI.BB, *FalseBBI.BB, in ValidForkedDiamond()
939 TrueBBICalc.BB = TrueBBI.BB; in ValidForkedDiamond()
941 TrueBBICalc.IsBrAnalyzable = TrueBBI.IsBrAnalyzable; in ValidForkedDiamond()
949 TrueBBICalc.NonPredSize = TrueBBI.NonPredSize; in ValidForkedDiamond()
957 BBInfo &TrueBBI, BBInfo &FalseBBI, in ValidDiamond() argument
961 if (TrueBBI.IsBeingAnalyzed || TrueBBI.IsDone || in ValidDiamond()
967 if (TrueBBI.BB == FalseBBI.BB) in ValidDiamond()
970 MachineBasicBlock *TT = TrueBBI.TrueBB; in ValidDiamond()
973 if (!TT && blockAlwaysFallThrough(TrueBBI)) in ValidDiamond()
974 TT = getNextBlock(*TrueBBI.BB); in ValidDiamond()
979 if (!TT && (TrueBBI.IsBrAnalyzable || FalseBBI.IsBrAnalyzable)) in ValidDiamond()
981 if (TrueBBI.BB->pred_size() > 1 || FalseBBI.BB->pred_size() > 1) in ValidDiamond()
985 if (TrueBBI.FalseBB || FalseBBI.FalseBB) in ValidDiamond()
993 TrueBBI.IsBrAnalyzable && FalseBBI.IsBrAnalyzable; in ValidDiamond()
994 MachineBasicBlock::iterator TIB = TrueBBI.BB->begin(); in ValidDiamond()
996 MachineBasicBlock::iterator TIE = TrueBBI.BB->end(); in ValidDiamond()
999 *TrueBBI.BB, *FalseBBI.BB, in ValidDiamond()
1003 TrueBBICalc.BB = TrueBBI.BB; in ValidDiamond()
1005 TrueBBICalc.IsBrAnalyzable = TrueBBI.IsBrAnalyzable; in ValidDiamond()
1012 TrueBBICalc.NonPredSize = TrueBBI.NonPredSize; in ValidDiamond()
1270 BBInfo &TrueBBI = BBAnalysis[BBI.TrueBB->getNumber()]; in AnalyzeBlock() local
1273 if (TrueBBI.IsDone && FalseBBI.IsDone) { in AnalyzeBlock()
1286 bool TNeedSub = !TrueBBI.Predicate.empty(); in AnalyzeBlock()
1290 BranchProbability Prediction = MBPI->getEdgeProbability(BB, TrueBBI.BB); in AnalyzeBlock()
1297 bool TrueFeasible = FeasibilityAnalysis(TrueBBI, BBI.BrCond, in AnalyzeBlock()
1306 if (ValidDiamond(TrueBBI, FalseBBI, Dups, Dups2, in AnalyzeBlock()
1322 } else if (ValidForkedDiamond(TrueBBI, FalseBBI, Dups, Dups2, in AnalyzeBlock()
1343 if (ValidTriangle(TrueBBI, FalseBBI, false, Dups, Prediction) && in AnalyzeBlock()
1344 MeetIfcvtSizeLimit(*TrueBBI.BB, TrueBBI.NonPredSize + TrueBBI.ExtraCost, in AnalyzeBlock()
1345 TrueBBI.ExtraCost2, Prediction) && in AnalyzeBlock()
1346 FeasibilityAnalysis(TrueBBI, BBI.BrCond, true)) { in AnalyzeBlock()
1359 if (ValidTriangle(TrueBBI, FalseBBI, true, Dups, Prediction) && in AnalyzeBlock()
1360 MeetIfcvtSizeLimit(*TrueBBI.BB, TrueBBI.NonPredSize + TrueBBI.ExtraCost, in AnalyzeBlock()
1361 TrueBBI.ExtraCost2, Prediction) && in AnalyzeBlock()
1362 FeasibilityAnalysis(TrueBBI, BBI.BrCond, true, true)) { in AnalyzeBlock()
1368 if (ValidSimple(TrueBBI, Dups, Prediction) && in AnalyzeBlock()
1369 MeetIfcvtSizeLimit(*TrueBBI.BB, TrueBBI.NonPredSize + TrueBBI.ExtraCost, in AnalyzeBlock()
1370 TrueBBI.ExtraCost2, Prediction) && in AnalyzeBlock()
1371 FeasibilityAnalysis(TrueBBI, BBI.BrCond)) { in AnalyzeBlock()
1386 if (ValidTriangle(FalseBBI, TrueBBI, false, Dups, in AnalyzeBlock()
1397 if (ValidTriangle(FalseBBI, TrueBBI, true, Dups, in AnalyzeBlock()
1520 BBInfo &TrueBBI = BBAnalysis[BBI.TrueBB->getNumber()]; in IfConvertSimple() local
1522 BBInfo *CvtBBI = &TrueBBI; in IfConvertSimple()
1605 BBInfo &TrueBBI = BBAnalysis[BBI.TrueBB->getNumber()]; in IfConvertTriangle() local
1607 BBInfo *CvtBBI = &TrueBBI; in IfConvertTriangle()
1759 BBInfo &BBI, BBInfo &TrueBBI, BBInfo &FalseBBI, in IfConvertDiamondCommon() argument
1764 if (TrueBBI.IsDone || FalseBBI.IsDone || in IfConvertDiamondCommon()
1765 TrueBBI.BB->pred_size() > 1 || FalseBBI.BB->pred_size() > 1) { in IfConvertDiamondCommon()
1768 TrueBBI.IsAnalyzed = false; in IfConvertDiamondCommon()
1773 if (TrueBBI.BB->hasAddressTaken() || FalseBBI.BB->hasAddressTaken()) in IfConvertDiamondCommon()
1780 BBInfo *BBI1 = &TrueBBI; in IfConvertDiamondCommon()
1793 if (TrueBBI.NonPredSize > FalseBBI.NonPredSize) in IfConvertDiamondCommon()
1996 BBInfo &TrueBBI = BBAnalysis[BBI.TrueBB->getNumber()]; in IfConvertForkedDiamond() local
2001 MachineBasicBlock::iterator TIE = TrueBBI.BB->getFirstTerminator(); in IfConvertForkedDiamond()
2002 if (TIE != TrueBBI.BB->end()) in IfConvertForkedDiamond()
2008 BBI, TrueBBI, FalseBBI, in IfConvertForkedDiamond()
2016 TII->insertBranch(*BBI.BB, TrueBBI.TrueBB, TrueBBI.FalseBB, in IfConvertForkedDiamond()
2017 TrueBBI.BrCond, dl); in IfConvertForkedDiamond()
2020 BBI.IsDone = TrueBBI.IsDone = FalseBBI.IsDone = true; in IfConvertForkedDiamond()
2031 BBInfo &TrueBBI = BBAnalysis[BBI.TrueBB->getNumber()]; in IfConvertDiamond() local
2033 MachineBasicBlock *TailBB = TrueBBI.TrueBB; in IfConvertDiamond()
2037 if (blockAlwaysFallThrough(TrueBBI)) in IfConvertDiamond()
2039 assert((TailBB || !TrueBBI.IsBrAnalyzable) && "Unexpected!"); in IfConvertDiamond()
2043 BBI, TrueBBI, FalseBBI, in IfConvertDiamond()
2046 /* RemoveBranch */ TrueBBI.IsBrAnalyzable, in IfConvertDiamond()
2057 BBI.BB->removeSuccessor(TrueBBI.BB); in IfConvertDiamond()
2076 if (*PI != TrueBBI.BB && *PI != FalseBBI.BB) in IfConvertDiamond()
2090 BBI.IsDone = TrueBBI.IsDone = FalseBBI.IsDone = true; in IfConvertDiamond()