summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCameron McInally <cameron.mcinally@nyu.edu>2019-06-28 19:57:31 +0000
committerCameron McInally <cameron.mcinally@nyu.edu>2019-06-28 19:57:31 +0000
commitab4b2364e566cad140d8113a8251bd388da72ade (patch)
tree203c314bf51c35a41b1eb0a3ffb8ba0d458cb4f2
parent9a6cef74d8a930baf3c0d9f41780bbef874f11a9 (diff)
downloadbcm5719-llvm-ab4b2364e566cad140d8113a8251bd388da72ade.tar.gz
bcm5719-llvm-ab4b2364e566cad140d8113a8251bd388da72ade.zip
[GVNSink] Add unary FNeg support to GVNSink pass
Differential Revision: https://reviews.llvm.org/D63900 llvm-svn: 364678
-rw-r--r--llvm/lib/Transforms/Scalar/GVNSink.cpp1
-rw-r--r--llvm/test/Transforms/GVNSink/fpmath.ll3
2 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/GVNSink.cpp b/llvm/lib/Transforms/Scalar/GVNSink.cpp
index 735f68329af..054025755c6 100644
--- a/llvm/lib/Transforms/Scalar/GVNSink.cpp
+++ b/llvm/lib/Transforms/Scalar/GVNSink.cpp
@@ -441,6 +441,7 @@ public:
break;
case Instruction::Call:
case Instruction::Invoke:
+ case Instruction::FNeg:
case Instruction::Add:
case Instruction::FAdd:
case Instruction::Sub:
diff --git a/llvm/test/Transforms/GVNSink/fpmath.ll b/llvm/test/Transforms/GVNSink/fpmath.ll
index 15d86845e0d..69e3a2471e7 100644
--- a/llvm/test/Transforms/GVNSink/fpmath.ll
+++ b/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
OpenPOWER on IntegriCloud