mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 20:23:11 +01:00
f51987bd8e
Differential Revision: https://reviews.llvm.org/D63900 llvm-svn: 364678
25 lines
466 B
LLVM
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
|
|
}
|