Lines Matching refs:TrueBBI
193 bool ValidSimple(BBInfo &TrueBBI, unsigned &Dups,
195 bool ValidTriangle(BBInfo &TrueBBI, BBInfo &FalseBBI,
198 bool ValidDiamond(BBInfo &TrueBBI, BBInfo &FalseBBI,
477 bool IfConverter::ValidSimple(BBInfo &TrueBBI, unsigned &Dups, in ValidSimple() argument
480 if (TrueBBI.IsBeingAnalyzed || TrueBBI.IsDone) in ValidSimple()
483 if (TrueBBI.IsBrAnalyzable) in ValidSimple()
486 if (TrueBBI.BB->pred_size() > 1) { in ValidSimple()
487 if (TrueBBI.CannotBeCopied || in ValidSimple()
488 !TII->isProfitableToDupForIfCvt(*TrueBBI.BB, TrueBBI.NonPredSize, in ValidSimple()
491 Dups = TrueBBI.NonPredSize; in ValidSimple()
503 bool IfConverter::ValidTriangle(BBInfo &TrueBBI, BBInfo &FalseBBI, in ValidTriangle() argument
507 if (TrueBBI.IsBeingAnalyzed || TrueBBI.IsDone) in ValidTriangle()
510 if (TrueBBI.BB->pred_size() > 1) { in ValidTriangle()
511 if (TrueBBI.CannotBeCopied) in ValidTriangle()
514 unsigned Size = TrueBBI.NonPredSize; in ValidTriangle()
515 if (TrueBBI.IsBrAnalyzable) { in ValidTriangle()
516 if (TrueBBI.TrueBB && TrueBBI.BrCond.empty()) in ValidTriangle()
521 ? TrueBBI.TrueBB : TrueBBI.FalseBB; in ValidTriangle()
527 if (!TII->isProfitableToDupForIfCvt(*TrueBBI.BB, Size, Prediction)) in ValidTriangle()
532 MachineBasicBlock *TExit = FalseBranch ? TrueBBI.FalseBB : TrueBBI.TrueBB; in ValidTriangle()
533 if (!TExit && blockAlwaysFallThrough(TrueBBI)) { in ValidTriangle()
534 MachineFunction::iterator I = TrueBBI.BB->getIterator(); in ValidTriangle()
535 if (++I == TrueBBI.BB->getParent()->end()) in ValidTriangle()
544 bool IfConverter::ValidDiamond(BBInfo &TrueBBI, BBInfo &FalseBBI, in ValidDiamond() argument
547 if (TrueBBI.IsBeingAnalyzed || TrueBBI.IsDone || in ValidDiamond()
551 MachineBasicBlock *TT = TrueBBI.TrueBB; in ValidDiamond()
554 if (!TT && blockAlwaysFallThrough(TrueBBI)) in ValidDiamond()
555 TT = getNextBlock(TrueBBI.BB); in ValidDiamond()
560 if (!TT && (TrueBBI.IsBrAnalyzable || FalseBBI.IsBrAnalyzable)) in ValidDiamond()
562 if (TrueBBI.BB->pred_size() > 1 || FalseBBI.BB->pred_size() > 1) in ValidDiamond()
566 if (TrueBBI.FalseBB || FalseBBI.FalseBB || in ValidDiamond()
567 (TrueBBI.ClobbersPred && FalseBBI.ClobbersPred)) in ValidDiamond()
571 MachineBasicBlock::iterator TIB = TrueBBI.BB->begin(); in ValidDiamond()
573 MachineBasicBlock::iterator TIE = TrueBBI.BB->end(); in ValidDiamond()
828 BBInfo &TrueBBI = BBAnalysis[BBI.TrueBB->getNumber()]; in AnalyzeBlock() local
831 if (TrueBBI.IsDone && FalseBBI.IsDone) { in AnalyzeBlock()
844 bool TNeedSub = !TrueBBI.Predicate.empty(); in AnalyzeBlock()
848 BranchProbability Prediction = MBPI->getEdgeProbability(BB, TrueBBI.BB); in AnalyzeBlock()
850 if (CanRevCond && ValidDiamond(TrueBBI, FalseBBI, Dups, Dups2) && in AnalyzeBlock()
851 MeetIfcvtSizeLimit(*TrueBBI.BB, (TrueBBI.NonPredSize - (Dups + Dups2) + in AnalyzeBlock()
852 TrueBBI.ExtraCost), TrueBBI.ExtraCost2, in AnalyzeBlock()
856 FeasibilityAnalysis(TrueBBI, BBI.BrCond) && in AnalyzeBlock()
871 if (ValidTriangle(TrueBBI, FalseBBI, false, Dups, Prediction) && in AnalyzeBlock()
872 MeetIfcvtSizeLimit(*TrueBBI.BB, TrueBBI.NonPredSize + TrueBBI.ExtraCost, in AnalyzeBlock()
873 TrueBBI.ExtraCost2, Prediction) && in AnalyzeBlock()
874 FeasibilityAnalysis(TrueBBI, BBI.BrCond, true)) { in AnalyzeBlock()
886 if (ValidTriangle(TrueBBI, FalseBBI, true, Dups, Prediction) && in AnalyzeBlock()
887 MeetIfcvtSizeLimit(*TrueBBI.BB, TrueBBI.NonPredSize + TrueBBI.ExtraCost, in AnalyzeBlock()
888 TrueBBI.ExtraCost2, Prediction) && in AnalyzeBlock()
889 FeasibilityAnalysis(TrueBBI, BBI.BrCond, true, true)) { in AnalyzeBlock()
894 if (ValidSimple(TrueBBI, Dups, Prediction) && in AnalyzeBlock()
895 MeetIfcvtSizeLimit(*TrueBBI.BB, TrueBBI.NonPredSize + TrueBBI.ExtraCost, in AnalyzeBlock()
896 TrueBBI.ExtraCost2, Prediction) && in AnalyzeBlock()
897 FeasibilityAnalysis(TrueBBI, BBI.BrCond)) { in AnalyzeBlock()
911 if (ValidTriangle(FalseBBI, TrueBBI, false, Dups, in AnalyzeBlock()
921 if (ValidTriangle(FalseBBI, TrueBBI, true, Dups, in AnalyzeBlock()
1072 BBInfo &TrueBBI = BBAnalysis[BBI.TrueBB->getNumber()]; in IfConvertSimple() local
1074 BBInfo *CvtBBI = &TrueBBI; in IfConvertSimple()
1158 BBInfo &TrueBBI = BBAnalysis[BBI.TrueBB->getNumber()]; in IfConvertTriangle() local
1160 BBInfo *CvtBBI = &TrueBBI; in IfConvertTriangle()
1306 BBInfo &TrueBBI = BBAnalysis[BBI.TrueBB->getNumber()]; in IfConvertDiamond() local
1308 MachineBasicBlock *TailBB = TrueBBI.TrueBB; in IfConvertDiamond()
1311 if (blockAlwaysFallThrough(TrueBBI)) in IfConvertDiamond()
1313 assert((TailBB || !TrueBBI.IsBrAnalyzable) && "Unexpected!"); in IfConvertDiamond()
1316 if (TrueBBI.IsDone || FalseBBI.IsDone || in IfConvertDiamond()
1317 TrueBBI.BB->pred_size() > 1 || in IfConvertDiamond()
1321 TrueBBI.IsAnalyzed = false; in IfConvertDiamond()
1326 if (TrueBBI.BB->hasAddressTaken() || FalseBBI.BB->hasAddressTaken()) in IfConvertDiamond()
1333 BBInfo *BBI1 = &TrueBBI; in IfConvertDiamond()
1343 if (TrueBBI.ClobbersPred && !FalseBBI.ClobbersPred) in IfConvertDiamond()
1345 else if (TrueBBI.ClobbersPred == FalseBBI.ClobbersPred) { in IfConvertDiamond()
1346 if (TrueBBI.NonPredSize > FalseBBI.NonPredSize) in IfConvertDiamond()
1519 BBI.IsDone = TrueBBI.IsDone = FalseBBI.IsDone = true; in IfConvertDiamond()