From: Dan Gohman Date: Mon, 29 Jun 2009 21:31:18 +0000 (+0000) Subject: Use getSCEV instead of getUnknown to create a SCEV for a X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=099879687f898bdad5d5ff4d74efe0c2e5e284d1;p=oota-llvm.git Use getSCEV instead of getUnknown to create a SCEV for a Constant. This lets ConstantInts be handled as SCEVConstant instead of SCEVUnknown, as getUnknown no longer has special-case code for ConstantInt and friends. This usually doesn't affect the final output, since the constants end up getting folded later, but it does make intermediate expressions more obvious in many cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74459 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index e38b24c0b57..2b8277864eb 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/lib/Analysis/ScalarEvolution.cpp @@ -3572,7 +3572,7 @@ const SCEV* ScalarEvolution::getSCEVAtScope(const SCEV *V, const Loop *L) { Constant *RV = getConstantEvolutionLoopExitValue(PN, BTCC->getValue()->getValue(), LI); - if (RV) return getUnknown(RV); + if (RV) return getSCEV(RV); } } @@ -3586,7 +3586,7 @@ const SCEV* ScalarEvolution::getSCEVAtScope(const SCEV *V, const Loop *L) { std::pair::iterator, bool> Pair = Values.insert(std::make_pair(L, static_cast(0))); if (!Pair.second) - return Pair.first->second ? &*getUnknown(Pair.first->second) : V; + return Pair.first->second ? &*getSCEV(Pair.first->second) : V; std::vector Operands; Operands.reserve(I->getNumOperands()); @@ -3635,7 +3635,7 @@ const SCEV* ScalarEvolution::getSCEVAtScope(const SCEV *V, const Loop *L) { C = ConstantFoldInstOperands(I->getOpcode(), I->getType(), &Operands[0], Operands.size()); Pair.first->second = C; - return getUnknown(C); + return getSCEV(C); } }