Extend the ValuesAtScope cache to cover all expressions, not just
[oota-llvm.git] / lib / Analysis / LoopVR.cpp
index 921d6ce06e91bcd6ffab3de76cecb9d3ff0db97c..573bd3ea01620ca6df2425e9a26a956eea88ffce 100644 (file)
@@ -73,9 +73,9 @@ ConstantRange LoopVR::getRange(const SCEV *S, const SCEV *T, ScalarEvolution &SE
     ConstantRange X = getRange(Mul->getOperand(0), T, SE);
     if (X.isFullSet()) return FullSet;
 
-    const IntegerType *Ty = IntegerType::get(X.getBitWidth());
-    const IntegerType *ExTy = IntegerType::get(X.getBitWidth() *
-                                               Mul->getNumOperands());
+    const IntegerType *Ty = IntegerType::get(SE.getContext(), X.getBitWidth());
+    const IntegerType *ExTy = IntegerType::get(SE.getContext(),
+                                      X.getBitWidth() * Mul->getNumOperands());
     ConstantRange XExt = X.zeroExtend(ExTy->getBitWidth());
 
     for (unsigned i = 1, e = Mul->getNumOperands(); i != e; ++i) {
@@ -228,8 +228,7 @@ void LoopVR::getAnalysisUsage(AnalysisUsage &AU) const {
 
 bool LoopVR::runOnFunction(Function &F) { Map.clear(); return false; }
 
-void LoopVR::print(std::ostream &os, const Module *) const {
-  raw_os_ostream OS(os);
+void LoopVR::print(raw_ostream &OS, const Module *) const {
   for (std::map<Value *, ConstantRange *>::const_iterator I = Map.begin(),
        E = Map.end(); I != E; ++I) {
     OS << *I->first << ": " << *I->second << '\n';