Index: llvm/trunk/lib/Transforms/Scalar/GVN.cpp =================================================================== --- llvm/trunk/lib/Transforms/Scalar/GVN.cpp +++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp @@ -492,6 +492,7 @@ switch (I->getOpcode()) { case Instruction::Call: return lookupOrAddCall(cast(I)); + case Instruction::FNeg: case Instruction::Add: case Instruction::FAdd: case Instruction::Sub: Index: llvm/trunk/test/Transforms/GVN/fpmath.ll =================================================================== --- llvm/trunk/test/Transforms/GVN/fpmath.ll +++ llvm/trunk/test/Transforms/GVN/fpmath.ll @@ -43,9 +43,8 @@ define double @test5(double %x, double %y) { ; CHECK: @test5(double %x, double %y) -; 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