Changes in directory llvm/lib/CodeGen:
IfConversion.cpp updated: 1.20 -> 1.21 --- Log message: Correctly mark early-exit on the false path. --- Diffs of the changes: (+9 -8) IfConversion.cpp | 17 +++++++++-------- 1 files changed, 9 insertions(+), 8 deletions(-) Index: llvm/lib/CodeGen/IfConversion.cpp diff -u llvm/lib/CodeGen/IfConversion.cpp:1.20 llvm/lib/CodeGen/IfConversion.cpp:1.21 --- llvm/lib/CodeGen/IfConversion.cpp:1.20 Fri Jun 1 02:41:07 2007 +++ llvm/lib/CodeGen/IfConversion.cpp Fri Jun 1 15:29:21 2007 @@ -33,6 +33,7 @@ ICReAnalyze, // BB must be re-analyzed. ICNotClassfied, // BB data valid, but not classified. ICEarlyExit, // BB is entry of an early-exit sub-CFG. + ICEarlyExitFalse,// Same as ICEarlyExit, but on the false path. ICTriangle, // BB is entry of a triangle sub-CFG. ICDiamond, // BB is entry of a diamond sub-CFG. ICChild, // BB is part of the sub-CFG that'll be predicated. @@ -151,6 +152,7 @@ // One or more of 'childrean' have been modified, abort! break; case ICEarlyExit: + case ICEarlyExitFalse: DOUT << "Ifcvt (Early exit): BB#" << BBI.BB->getNumber() << "\n"; Change |= IfConvertEarlyExit(BBI); break; @@ -239,7 +241,7 @@ TrueBBI.Kind = ICChild; } else if (!(TrueBBI.hasEarlyExit && TrueNumPreds <= 1) && (FalseBBI.hasEarlyExit && FalseNumPreds <=1)) { - BBI.Kind = ICEarlyExit; + BBI.Kind = ICEarlyExitFalse; FalseBBI.Kind = ICChild; } else if (TrueBBI.TrueBB && TrueBBI.TrueBB == BBI.FalseBB) { // Triangle: @@ -335,6 +337,7 @@ BBInfo &BBI = BBAnalysis[BB->getNumber()]; switch (BBI.Kind) { case ICEarlyExit: + case ICEarlyExitFalse: case ICTriangle: case ICDiamond: Candidates.push_back(&BBI); @@ -406,6 +409,8 @@ /// IfConvertEarlyExit - If convert a early exit sub-CFG. /// bool IfConverter::IfConvertEarlyExit(BBInfo &BBI) { + bool ReverseCond = BBI.Kind == ICEarlyExitFalse; + BBI.Kind = ICNotClassfied; BBInfo &TrueBBI = BBAnalysis[BBI.TrueBB->getNumber()]; @@ -413,15 +418,11 @@ BBInfo *CvtBBI = &TrueBBI; BBInfo *NextBBI = &FalseBBI; - bool ReserveCond = false; - if (TrueBBI.Kind != ICChild) { - std::swap(CvtBBI, NextBBI); - ReserveCond = true; - } - std::vector<MachineOperand> NewCond(BBI.BrCond); - if (ReserveCond) + if (ReverseCond) { + std::swap(CvtBBI, NextBBI); TII->ReverseBranchCondition(NewCond); + } FeasibilityAnalysis(*CvtBBI, NewCond); if (!CvtBBI->isPredicable) return false; _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits