[llvm] r310397 - [NewGVN] Use a cast instead of a dyn_cast.
Chad Rosier via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 8 11:41:49 PDT 2017
Author: mcrosier
Date: Tue Aug 8 11:41:49 2017
New Revision: 310397
URL: http://llvm.org/viewvc/llvm-project?rev=310397&view=rev
Log:
[NewGVN] Use a cast instead of a dyn_cast.
Differential Revision: https://reviews.llvm.org/D36478
Modified:
llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp?rev=310397&r1=310396&r2=310397&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp Tue Aug 8 11:41:49 2017
@@ -1711,7 +1711,9 @@ NewGVN::performSymbolicAggrValueEvaluati
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));
More information about the llvm-commits
mailing list