Restore the PHI optimization I accidently removed

llvm-svn: 170024
This commit is contained in:
Michael Ilseman 2012-12-12 20:59:36 +00:00
parent 5ff8f96e19
commit 6db2e9667a

View File

@ -354,6 +354,10 @@ Instruction *InstCombiner::visitFAdd(BinaryOperator &I) {
if (Value *V = SimplifyFAddInst(LHS, RHS, I.getFastMathFlags(), TD))
return ReplaceInstUsesWith(I, V);
if (isa<PHINode>(LHS))
if (Instruction *NV = FoldOpIntoPhi(I))
return NV;
// -A + B --> B - A
// -A + -B --> -(A + B)
if (Value *LHSV = dyn_castFNegVal(LHS))