1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 12:12:47 +01:00

[Reassociate] simplify code; NFCI

llvm-svn: 318298
This commit is contained in:
Sanjay Patel 2017-11-15 16:19:17 +00:00
parent ffa5657a2b
commit 7b98bb7dd7

View File

@ -798,12 +798,9 @@ void ReassociatePass::RewriteExprTree(BinaryOperator *I,
/// additional opportunities have been exposed. /// additional opportunities have been exposed.
static Value *NegateValue(Value *V, Instruction *BI, static Value *NegateValue(Value *V, Instruction *BI,
SetVector<AssertingVH<Instruction>> &ToRedo) { SetVector<AssertingVH<Instruction>> &ToRedo) {
if (Constant *C = dyn_cast<Constant>(V)) { if (auto *C = dyn_cast<Constant>(V))
if (C->getType()->isFPOrFPVectorTy()) { return C->getType()->isFPOrFPVectorTy() ? ConstantExpr::getFNeg(C) :
return ConstantExpr::getFNeg(C); ConstantExpr::getNeg(C);
}
return ConstantExpr::getNeg(C);
}
// We are trying to expose opportunity for reassociation. One of the things // We are trying to expose opportunity for reassociation. One of the things
// that we want to do to achieve this is to push a negation as deep into an // that we want to do to achieve this is to push a negation as deep into an