[PATCH] D36478: [NewGVN] Use a cast instead of a dyn_cast.
Chad Rosier via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 8 11:42:45 PDT 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL310397: [NewGVN] Use a cast instead of a dyn_cast. (authored by mcrosier).
Changed prior to commit:
https://reviews.llvm.org/D36478?vs=110238&id=110244#toc
Repository:
rL LLVM
https://reviews.llvm.org/D36478
Files:
llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp
Index: llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp
===================================================================
--- llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp
+++ llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp
@@ -1711,7 +1711,9 @@
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));
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36478.110244.patch
Type: text/x-patch
Size: 666 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170808/a128a773/attachment.bin>
More information about the llvm-commits
mailing list