]> granicus.if.org Git - llvm/commitdiff
[NewGVN] Use a cast instead of a dyn_cast.
authorChad Rosier <mcrosier@codeaurora.org>
Tue, 8 Aug 2017 18:41:49 +0000 (18:41 +0000)
committerChad Rosier <mcrosier@codeaurora.org>
Tue, 8 Aug 2017 18:41:49 +0000 (18:41 +0000)
Differential Revision: https://reviews.llvm.org/D36478

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310397 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/NewGVN.cpp

index d6e34666112a3fc8053c3e069a51f6dcd1ffab57..e620ae9c557f3ce53b6f8c0dc46101370d24174d 100644 (file)
@@ -1711,7 +1711,9 @@ NewGVN::performSymbolicAggrValueEvaluation(Instruction *I) const {
   return createAggregateValueExpression(I);
 }
 const Expression *NewGVN::performSymbolicCmpEvaluation(Instruction *I) const {
-  auto *CI = dyn_cast<CmpInst>(I);
+  assert(isa<CmpInst>(I) && "Expected a cmp instruction.");
+
+  auto *CI = cast<CmpInst>(I);
   // See if our operands are equal to those of a previous predicate, and if so,
   // if it implies true or false.
   auto Op0 = lookupOperandLeader(CI->getOperand(0));