From: Jakub Staszak Date: Wed, 6 Mar 2013 00:16:16 +0000 (+0000) Subject: Use dyn_cast instead of isa && cast. No functionality change. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=603e874c64c2328cf29395e328bf77c1851068d2;p=oota-llvm.git Use dyn_cast instead of isa && cast. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176537 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/ValueTracking.cpp b/lib/Analysis/ValueTracking.cpp index 8e3994e8f52..45b75df5087 100644 --- a/lib/Analysis/ValueTracking.cpp +++ b/lib/Analysis/ValueTracking.cpp @@ -1396,10 +1396,10 @@ bool llvm::CannotBeNegativeZero(const Value *V, unsigned Depth) { return true; // (add x, 0.0) is guaranteed to return +0.0, not -0.0. - if (I->getOpcode() == Instruction::FAdd && - isa(I->getOperand(1)) && - cast(I->getOperand(1))->isNullValue()) - return true; + if (I->getOpcode() == Instruction::FAdd) + if (ConstantFP *CFP = dyn_cast(I->getOperand(1))) + if (CFP->isNullValue()) + return true; // sitofp and uitofp turn into +0.0 for zero. if (isa(I) || isa(I))