[llvm] r364678 - [GVNSink] Add unary FNeg support to GVNSink pass
Cameron McInally via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 28 12:57:31 PDT 2019
Author: mcinally
Date: Fri Jun 28 12:57:31 2019
New Revision: 364678
URL: http://llvm.org/viewvc/llvm-project?rev=364678&view=rev
Log:
[GVNSink] Add unary FNeg support to GVNSink pass
Differential Revision: https://reviews.llvm.org/D63900
Modified:
llvm/trunk/lib/Transforms/Scalar/GVNSink.cpp
llvm/trunk/test/Transforms/GVNSink/fpmath.ll
Modified: llvm/trunk/lib/Transforms/Scalar/GVNSink.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVNSink.cpp?rev=364678&r1=364677&r2=364678&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/GVNSink.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/GVNSink.cpp Fri Jun 28 12:57:31 2019
@@ -441,6 +441,7 @@ public:
break;
case Instruction::Call:
case Instruction::Invoke:
+ case Instruction::FNeg:
case Instruction::Add:
case Instruction::FAdd:
case Instruction::Sub:
Modified: llvm/trunk/test/Transforms/GVNSink/fpmath.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVNSink/fpmath.ll?rev=364678&r1=364677&r2=364678&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/GVNSink/fpmath.ll (original)
+++ llvm/trunk/test/Transforms/GVNSink/fpmath.ll Fri Jun 28 12:57:31 2019
@@ -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
More information about the llvm-commits
mailing list