convert another operand loop to iterator formulation
[oota-llvm.git] / lib / Analysis / ScalarEvolution.cpp
index b757531bc112e65fee6eb24a687f4c342ca4456c..e01cf51794efc1653654c12ef11715218f76912e 100644 (file)
@@ -95,16 +95,14 @@ STATISTIC(NumTripCountsNotComputed,
 STATISTIC(NumBruteForceTripCountsComputed,
           "Number of loops with trip counts computed by force");
 
-cl::opt<unsigned>
+static cl::opt<unsigned>
 MaxBruteForceIterations("scalar-evolution-max-iterations", cl::ReallyHidden,
                         cl::desc("Maximum number of iterations SCEV will "
                                  "symbolically execute a constant derived loop"),
                         cl::init(100));
 
-namespace {
-  RegisterPass<ScalarEvolution>
-  R("scalar-evolution", "Scalar Evolution Analysis", false, true);
-}
+static RegisterPass<ScalarEvolution>
+R("scalar-evolution", "Scalar Evolution Analysis", false, true);
 char ScalarEvolution::ID = 0;
 
 //===----------------------------------------------------------------------===//
@@ -2550,9 +2548,9 @@ SCEVHandle ScalarEvolutionsImpl::HowFarToZero(SCEV *V, const Loop *L) {
       if (SCEVConstant *StartC = dyn_cast<SCEVConstant>(Start)) {
         ConstantInt *StartCC = StartC->getValue();
         Constant *StartNegC = ConstantExpr::getNeg(StartCC);
-        Constant *Rem = ConstantExpr::getSRem(StartNegC, StepC->getValue());
+        Constant *Rem = ConstantExpr::getURem(StartNegC, StepC->getValue());
         if (Rem->isNullValue()) {
-          Constant *Result =ConstantExpr::getSDiv(StartNegC,StepC->getValue());
+          Constant *Result = ConstantExpr::getUDiv(StartNegC,StepC->getValue());
           return SE.getUnknown(Result);
         }
       }