1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

Use dyn_cast instead of isa && cast. No functionality change.

llvm-svn: 176537
This commit is contained in:
Jakub Staszak 2013-03-06 00:16:16 +00:00
parent 0096b95782
commit 0181305df8

View File

@ -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))