Lines Matching refs:TrueBBI
176 bool ValidSimple(BBInfo &TrueBBI, unsigned &Dups,
178 bool ValidTriangle(BBInfo &TrueBBI, BBInfo &FalseBBI,
181 bool ValidDiamond(BBInfo &TrueBBI, BBInfo &FalseBBI,
453 bool IfConverter::ValidSimple(BBInfo &TrueBBI, unsigned &Dups, in ValidSimple() argument
456 if (TrueBBI.IsBeingAnalyzed || TrueBBI.IsDone) in ValidSimple()
459 if (TrueBBI.IsBrAnalyzable) in ValidSimple()
462 if (TrueBBI.BB->pred_size() > 1) { in ValidSimple()
463 if (TrueBBI.CannotBeCopied || in ValidSimple()
464 !TII->isProfitableToDupForIfCvt(*TrueBBI.BB, TrueBBI.NonPredSize, in ValidSimple()
467 Dups = TrueBBI.NonPredSize; in ValidSimple()
479 bool IfConverter::ValidTriangle(BBInfo &TrueBBI, BBInfo &FalseBBI, in ValidTriangle() argument
483 if (TrueBBI.IsBeingAnalyzed || TrueBBI.IsDone) in ValidTriangle()
486 if (TrueBBI.BB->pred_size() > 1) { in ValidTriangle()
487 if (TrueBBI.CannotBeCopied) in ValidTriangle()
490 unsigned Size = TrueBBI.NonPredSize; in ValidTriangle()
491 if (TrueBBI.IsBrAnalyzable) { in ValidTriangle()
492 if (TrueBBI.TrueBB && TrueBBI.BrCond.empty()) in ValidTriangle()
497 ? TrueBBI.TrueBB : TrueBBI.FalseBB; in ValidTriangle()
503 if (!TII->isProfitableToDupForIfCvt(*TrueBBI.BB, Size, Prediction)) in ValidTriangle()
508 MachineBasicBlock *TExit = FalseBranch ? TrueBBI.FalseBB : TrueBBI.TrueBB; in ValidTriangle()
509 if (!TExit && blockAlwaysFallThrough(TrueBBI)) { in ValidTriangle()
510 MachineFunction::iterator I = TrueBBI.BB; in ValidTriangle()
511 if (++I == TrueBBI.BB->getParent()->end()) in ValidTriangle()
520 bool IfConverter::ValidDiamond(BBInfo &TrueBBI, BBInfo &FalseBBI, in ValidDiamond() argument
523 if (TrueBBI.IsBeingAnalyzed || TrueBBI.IsDone || in ValidDiamond()
527 MachineBasicBlock *TT = TrueBBI.TrueBB; in ValidDiamond()
530 if (!TT && blockAlwaysFallThrough(TrueBBI)) in ValidDiamond()
531 TT = getNextBlock(TrueBBI.BB); in ValidDiamond()
536 if (TT == NULL && (TrueBBI.IsBrAnalyzable || FalseBBI.IsBrAnalyzable)) in ValidDiamond()
538 if (TrueBBI.BB->pred_size() > 1 || FalseBBI.BB->pred_size() > 1) in ValidDiamond()
542 if (TrueBBI.FalseBB || FalseBBI.FalseBB || in ValidDiamond()
543 (TrueBBI.ClobbersPred && FalseBBI.ClobbersPred)) in ValidDiamond()
547 MachineBasicBlock::iterator TIB = TrueBBI.BB->begin(); in ValidDiamond()
549 MachineBasicBlock::iterator TIE = TrueBBI.BB->end(); in ValidDiamond()
776 BBInfo &TrueBBI = AnalyzeBlock(BBI.TrueBB, Tokens); in AnalyzeBlock() local
779 if (TrueBBI.IsDone && FalseBBI.IsDone) { in AnalyzeBlock()
790 bool TNeedSub = TrueBBI.Predicate.size() > 0; in AnalyzeBlock()
794 BranchProbability Prediction = MBPI->getEdgeProbability(BB, TrueBBI.BB); in AnalyzeBlock()
796 if (CanRevCond && ValidDiamond(TrueBBI, FalseBBI, Dups, Dups2) && in AnalyzeBlock()
797 MeetIfcvtSizeLimit(*TrueBBI.BB, (TrueBBI.NonPredSize - (Dups + Dups2) + in AnalyzeBlock()
798 TrueBBI.ExtraCost), TrueBBI.ExtraCost2, in AnalyzeBlock()
802 FeasibilityAnalysis(TrueBBI, BBI.BrCond) && in AnalyzeBlock()
817 if (ValidTriangle(TrueBBI, FalseBBI, false, Dups, Prediction) && in AnalyzeBlock()
818 MeetIfcvtSizeLimit(*TrueBBI.BB, TrueBBI.NonPredSize + TrueBBI.ExtraCost, in AnalyzeBlock()
819 TrueBBI.ExtraCost2, Prediction) && in AnalyzeBlock()
820 FeasibilityAnalysis(TrueBBI, BBI.BrCond, true)) { in AnalyzeBlock()
832 if (ValidTriangle(TrueBBI, FalseBBI, true, Dups, Prediction) && in AnalyzeBlock()
833 MeetIfcvtSizeLimit(*TrueBBI.BB, TrueBBI.NonPredSize + TrueBBI.ExtraCost, in AnalyzeBlock()
834 TrueBBI.ExtraCost2, Prediction) && in AnalyzeBlock()
835 FeasibilityAnalysis(TrueBBI, BBI.BrCond, true, true)) { in AnalyzeBlock()
840 if (ValidSimple(TrueBBI, Dups, Prediction) && in AnalyzeBlock()
841 MeetIfcvtSizeLimit(*TrueBBI.BB, TrueBBI.NonPredSize + TrueBBI.ExtraCost, in AnalyzeBlock()
842 TrueBBI.ExtraCost2, Prediction) && in AnalyzeBlock()
843 FeasibilityAnalysis(TrueBBI, BBI.BrCond)) { in AnalyzeBlock()
857 if (ValidTriangle(FalseBBI, TrueBBI, false, Dups, in AnalyzeBlock()
867 if (ValidTriangle(FalseBBI, TrueBBI, true, Dups, in AnalyzeBlock()
1019 BBInfo &TrueBBI = BBAnalysis[BBI.TrueBB->getNumber()]; in IfConvertSimple() local
1021 BBInfo *CvtBBI = &TrueBBI; in IfConvertSimple()
1091 BBInfo &TrueBBI = BBAnalysis[BBI.TrueBB->getNumber()]; in IfConvertTriangle() local
1093 BBInfo *CvtBBI = &TrueBBI; in IfConvertTriangle()
1203 BBInfo &TrueBBI = BBAnalysis[BBI.TrueBB->getNumber()]; in IfConvertDiamond() local
1205 MachineBasicBlock *TailBB = TrueBBI.TrueBB; in IfConvertDiamond()
1208 if (blockAlwaysFallThrough(TrueBBI)) in IfConvertDiamond()
1210 assert((TailBB || !TrueBBI.IsBrAnalyzable) && "Unexpected!"); in IfConvertDiamond()
1213 if (TrueBBI.IsDone || FalseBBI.IsDone || in IfConvertDiamond()
1214 TrueBBI.BB->pred_size() > 1 || in IfConvertDiamond()
1218 TrueBBI.IsAnalyzed = false; in IfConvertDiamond()
1226 BBInfo *BBI1 = &TrueBBI; in IfConvertDiamond()
1236 if (TrueBBI.ClobbersPred && !FalseBBI.ClobbersPred) in IfConvertDiamond()
1238 else if (TrueBBI.ClobbersPred == FalseBBI.ClobbersPred) { in IfConvertDiamond()
1239 if (TrueBBI.NonPredSize > FalseBBI.NonPredSize) in IfConvertDiamond()
1352 BBI.IsDone = TrueBBI.IsDone = FalseBBI.IsDone = true; in IfConvertDiamond()