1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00
llvm-mirror/test/Transforms/GVNSink/fpmath.ll
Cameron McInally f51987bd8e [GVNSink] Add unary FNeg support to GVNSink pass
Differential Revision: https://reviews.llvm.org/D63900

llvm-svn: 364678
2019-06-28 19:57:31 +00:00

25 lines
466 B
LLVM

; RUN: opt -S < %s -gvn-sink | FileCheck %s
; CHECK-LABEL: sink
; 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
if.then:
%sub = fsub float %a, %b
%neg0 = fneg float %sub
br label %if.end
if.else:
%add = fadd float %a, %b
%neg1 = fneg float %add
br label %if.end
if.end:
%phi = phi float [ %neg0, %if.then ], [ %neg1, %if.else ]
ret float %phi
}