]> granicus.if.org Git - llvm/commitdiff
[GVNSink] Add unary FNeg support to GVNSink pass
authorCameron McInally <cameron.mcinally@nyu.edu>
Fri, 28 Jun 2019 19:57:31 +0000 (19:57 +0000)
committerCameron McInally <cameron.mcinally@nyu.edu>
Fri, 28 Jun 2019 19:57:31 +0000 (19:57 +0000)
Differential Revision: https://reviews.llvm.org/D63900

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364678 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/GVNSink.cpp
test/Transforms/GVNSink/fpmath.ll

index 735f68329af5fc7c1297638cb44d07255acb4fab..054025755c69aaf38920b97d94a49bf2ef80fd15 100644 (file)
@@ -441,6 +441,7 @@ public:
       break;
     case Instruction::Call:
     case Instruction::Invoke:
+    case Instruction::FNeg:
     case Instruction::Add:
     case Instruction::FAdd:
     case Instruction::Sub:
index 15d86845e0d593f1ccbb5d5858d8f2b093092773..69e3a2471e7bc3095d16b9d1faa93fc3569fe78b 100644 (file)
@@ -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