diff --git a/llvm/lib/Transforms/Scalar/LoopFlatten.cpp b/llvm/lib/Transforms/Scalar/LoopFlatten.cpp --- a/llvm/lib/Transforms/Scalar/LoopFlatten.cpp +++ b/llvm/lib/Transforms/Scalar/LoopFlatten.cpp @@ -411,7 +411,7 @@ // pre-header and one from the latch. The incoming latch value is the // increment variable. Increment = - dyn_cast(InductionPHI->getIncomingValueForBlock(Latch)); + cast(InductionPHI->getIncomingValueForBlock(Latch)); if (Increment->hasNUsesOrMore(3)) { LLVM_DEBUG(dbgs() << "Could not find valid increment\n"); return false;