[PATCH] D63900: [GVNSink] Add unary FNeg support to GVNSink pass

Cameron McInally via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 27 14:49:50 PDT 2019


cameron.mcinally created this revision.
cameron.mcinally added reviewers: spatel, arsenm, kpn, andrew.w.kaylor, craig.topper.
Herald added subscribers: llvm-commits, hiraditya, wdng.
Herald added a project: LLVM.

Repository:
  rL LLVM

https://reviews.llvm.org/D63900

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


Index: llvm/test/Transforms/GVNSink/fpmath.ll
===================================================================
--- llvm/test/Transforms/GVNSink/fpmath.ll
+++ llvm/test/Transforms/GVNSink/fpmath.ll
@@ -1,8 +1,9 @@
 ; RUN: opt -S < %s -gvn-sink | FileCheck %s
 
 ; CHECK-LABEL: sink
-; CHECK: fneg
+; CHECK-NOT: fneg
 ; CHECK: = phi
+; CHECK: fneg
 define float @sink(float %a, float %b, i1 %cmp) {
 entry:
   br i1 %cmp, label %if.then, label %if.else
Index: llvm/lib/Transforms/Scalar/GVNSink.cpp
===================================================================
--- llvm/lib/Transforms/Scalar/GVNSink.cpp
+++ llvm/lib/Transforms/Scalar/GVNSink.cpp
@@ -441,6 +441,7 @@
       break;
     case Instruction::Call:
     case Instruction::Invoke:
+    case Instruction::FNeg:
     case Instruction::Add:
     case Instruction::FAdd:
     case Instruction::Sub:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63900.206942.patch
Type: text/x-patch
Size: 862 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190627/e9e716c1/attachment.bin>


More information about the llvm-commits mailing list