diff options
author | Jakub Staszak <kubastaszak@gmail.com> | 2013-03-06 00:16:16 +0000 |
---|---|---|
committer | Jakub Staszak <kubastaszak@gmail.com> | 2013-03-06 00:16:16 +0000 |
commit | 603e874c64c2328cf29395e328bf77c1851068d2 (patch) | |
tree | 753ab8e1c1ce3d1596f5a9e3fd5c3e847bffd2af /lib/Analysis | |
parent | 62c102360ad39e005c3c8c42fe85bfc9f2f23474 (diff) | |
download | external_llvm-603e874c64c2328cf29395e328bf77c1851068d2.zip external_llvm-603e874c64c2328cf29395e328bf77c1851068d2.tar.gz external_llvm-603e874c64c2328cf29395e328bf77c1851068d2.tar.bz2 |
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
Diffstat (limited to 'lib/Analysis')
-rw-r--r-- | lib/Analysis/ValueTracking.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Analysis/ValueTracking.cpp b/lib/Analysis/ValueTracking.cpp index 8e3994e..45b75df 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<ConstantFP>(I->getOperand(1)) && - cast<ConstantFP>(I->getOperand(1))->isNullValue()) - return true; + if (I->getOpcode() == Instruction::FAdd) + if (ConstantFP *CFP = dyn_cast<ConstantFP>(I->getOperand(1))) + if (CFP->isNullValue()) + return true; // sitofp and uitofp turn into +0.0 for zero. if (isa<SIToFPInst>(I) || isa<UIToFPInst>(I)) |