[llvm] r364680 - [NewGVN] Add unary FNeg support to NewGVN pass

Cameron McInally via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 28 13:09:32 PDT 2019


Author: mcinally
Date: Fri Jun 28 13:09:32 2019
New Revision: 364680

URL: http://llvm.org/viewvc/llvm-project?rev=364680&view=rev
Log:
[NewGVN] Add unary FNeg support to NewGVN pass

Differential Revision: https://reviews.llvm.org/D63933

Modified:
    llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp
    llvm/trunk/test/Transforms/NewGVN/fpmath.ll

Modified: llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp?rev=364680&r1=364679&r2=364680&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp Fri Jun 28 13:09:32 2019
@@ -1991,6 +1991,7 @@ NewGVN::performSymbolicEvaluation(Value
     case Instruction::FCmp:
       E = performSymbolicCmpEvaluation(I);
       break;
+    case Instruction::FNeg:
     case Instruction::Add:
     case Instruction::FAdd:
     case Instruction::Sub:

Modified: llvm/trunk/test/Transforms/NewGVN/fpmath.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/NewGVN/fpmath.ll?rev=364680&r1=364679&r2=364680&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/NewGVN/fpmath.ll (original)
+++ llvm/trunk/test/Transforms/NewGVN/fpmath.ll Fri Jun 28 13:09:32 2019
@@ -43,9 +43,8 @@ define double @test4(double %x, double %
 
 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




More information about the llvm-commits mailing list