[PATCH] D63933: [NewGVN] Add unary FNeg support to NewGVN pass

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 28 13:10:53 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL364680: [NewGVN] Add unary FNeg support to NewGVN pass (authored by mcinally, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D63933?vs=207065&id=207132#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63933/new/

https://reviews.llvm.org/D63933

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


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
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:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63933.207132.patch
Type: text/x-patch
Size: 1066 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190628/7c173a35/attachment.bin>


More information about the llvm-commits mailing list