Allow NULL LoopPassManager argument in UnrollLoop. PR12734.

llvm-svn: 156358
This commit is contained in:
Andrew Trick
2012-05-08 02:52:09 +00:00
parent 9f5616a005
commit d29cd732d4
2 changed files with 24 additions and 18 deletions

View File

@@ -237,6 +237,8 @@ bool llvm::UnrollRuntimeLoopProlog(Loop *L, unsigned Count, LoopInfo *LI,
// Use Scalar Evolution to compute the trip count. This allows more
// loops to be unrolled than relying on induction var simplification
if (!LPM)
return false;
ScalarEvolution *SE = LPM->getAnalysisIfAvailable<ScalarEvolution>();
if (SE == 0)
return false;