diff options
author | Dan Gohman <gohman@apple.com> | 2010-07-20 16:44:52 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-07-20 16:44:52 +0000 |
commit | 4fd92434f112fe5ad492df782fe163df3e7aa558 (patch) | |
tree | 6de04c04c70fd1865432dc594efb952ed5afcd02 /llvm/lib/Analysis/ScalarEvolutionExpander.cpp | |
parent | 3eae1b3b4b6916bbd30c8c41c4516ab11b30c2e7 (diff) | |
download | bcm5719-llvm-4fd92434f112fe5ad492df782fe163df3e7aa558.tar.gz bcm5719-llvm-4fd92434f112fe5ad492df782fe163df3e7aa558.zip |
Make getOrInsertCanonicalInductionVariable guarantee that its
result is a PHINode*.
llvm-svn: 108852
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolutionExpander.cpp')
-rw-r--r-- | llvm/lib/Analysis/ScalarEvolutionExpander.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp index 0f3e33fe531..6017c51fc63 100644 --- a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp +++ b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp @@ -1349,7 +1349,7 @@ void SCEVExpander::restoreInsertPoint(BasicBlock *BB, BasicBlock::iterator I) { /// canonical induction variable of the specified type for the specified /// loop (inserting one if there is none). A canonical induction variable /// starts at zero and steps by one on each iteration. -Value * +PHINode * SCEVExpander::getOrInsertCanonicalInductionVariable(const Loop *L, const Type *Ty) { assert(Ty->isIntegerTy() && "Can only insert integer induction variables!"); @@ -1357,7 +1357,7 @@ SCEVExpander::getOrInsertCanonicalInductionVariable(const Loop *L, SE.getConstant(Ty, 1), L); BasicBlock *SaveInsertBB = Builder.GetInsertBlock(); BasicBlock::iterator SaveInsertPt = Builder.GetInsertPoint(); - Value *V = expandCodeFor(H, 0, L->getHeader()->begin()); + PHINode *V = cast<PHINode>(expandCodeFor(H, 0, L->getHeader()->begin())); if (SaveInsertBB) restoreInsertPoint(SaveInsertBB, SaveInsertPt); return V; |