[PATCH] D32874: [JumpThreading] Change a dyn_cast that is already protected by an isa check to a static cast. Combine the with another static cast. NFC
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 4 12:56:39 PDT 2017
efriedma added inline comments.
================
Comment at: lib/Transforms/Scalar/JumpThreading.cpp:583
// live-in value on any predecessors.
if (isa<Constant>(Cmp->getOperand(1)) && Cmp->getType()->isIntegerTy()) {
+ Constant *CmpConst = cast<Constant>(Cmp->getOperand(1));
----------------
"Cmp->getType()->isIntegerTy()" is always true, so you could just make this "if (Constant *CmpConst = dyn_cast<Constant>(Cmp->getOperand(1)))".
https://reviews.llvm.org/D32874
More information about the llvm-commits
mailing list