OSDN Git Service

[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 735f683..0540257 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 15d8684..69e3a24 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