Index: llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp =================================================================== --- llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp +++ llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp @@ -1991,6 +1991,7 @@ case Instruction::FCmp: E = performSymbolicCmpEvaluation(I); break; + case Instruction::FNeg: case Instruction::Add: case Instruction::FAdd: case Instruction::Sub: Index: llvm/trunk/test/Transforms/NewGVN/fpmath.ll =================================================================== --- llvm/trunk/test/Transforms/NewGVN/fpmath.ll +++ llvm/trunk/test/Transforms/NewGVN/fpmath.ll @@ -43,9 +43,8 @@ define double @test5(double %x) { ; CHECK: @test5(double %x) -; CHECK: %neg1 = fneg double %x, !fpmath !0 -; CHECK: %neg2 = fneg double %x, !fpmath !1 -; CHECK: %foo = fadd double %neg1, %neg2 +; CHECK: %neg1 = fneg double %x, !fpmath !1 +; CHECK: %foo = fadd double %neg1, %neg1 %neg1 = fneg double %x, !fpmath !0 %neg2 = fneg double %x, !fpmath !1 %foo = fadd double %neg1, %neg2