forked from OSchip/llvm-project
[InstSimplify] add tests for minnum/maxnum with shared op; NFC
llvm-svn: 339142
This commit is contained in:
parent
b802d18df7
commit
b06d283909
|
@ -601,3 +601,91 @@ define float @maxnum_same_args(float %x) {
|
|||
ret float %y
|
||||
}
|
||||
|
||||
define float @minnum_x_minnum_x_y(float %x, float %y) {
|
||||
; CHECK-LABEL: @minnum_x_minnum_x_y(
|
||||
; CHECK-NEXT: [[A:%.*]] = call float @llvm.minnum.f32(float [[X:%.*]], float [[Y:%.*]])
|
||||
; CHECK-NEXT: [[B:%.*]] = call float @llvm.minnum.f32(float [[X]], float [[A]])
|
||||
; CHECK-NEXT: ret float [[B]]
|
||||
;
|
||||
%a = call float @llvm.minnum.f32(float %x, float %y)
|
||||
%b = call float @llvm.minnum.f32(float %x, float %a)
|
||||
ret float %b
|
||||
}
|
||||
|
||||
define float @minnum_y_minnum_x_y(float %x, float %y) {
|
||||
; CHECK-LABEL: @minnum_y_minnum_x_y(
|
||||
; CHECK-NEXT: [[A:%.*]] = call float @llvm.minnum.f32(float [[X:%.*]], float [[Y:%.*]])
|
||||
; CHECK-NEXT: [[B:%.*]] = call float @llvm.minnum.f32(float [[Y]], float [[A]])
|
||||
; CHECK-NEXT: ret float [[B]]
|
||||
;
|
||||
%a = call float @llvm.minnum.f32(float %x, float %y)
|
||||
%b = call float @llvm.minnum.f32(float %y, float %a)
|
||||
ret float %b
|
||||
}
|
||||
|
||||
define float @minnum_x_y_minnum_x(float %x, float %y) {
|
||||
; CHECK-LABEL: @minnum_x_y_minnum_x(
|
||||
; CHECK-NEXT: [[A:%.*]] = call float @llvm.minnum.f32(float [[X:%.*]], float [[Y:%.*]])
|
||||
; CHECK-NEXT: [[B:%.*]] = call float @llvm.minnum.f32(float [[A]], float [[X]])
|
||||
; CHECK-NEXT: ret float [[B]]
|
||||
;
|
||||
%a = call float @llvm.minnum.f32(float %x, float %y)
|
||||
%b = call float @llvm.minnum.f32(float %a, float %x)
|
||||
ret float %b
|
||||
}
|
||||
|
||||
define float @minnum_x_y_minnum_y(float %x, float %y) {
|
||||
; CHECK-LABEL: @minnum_x_y_minnum_y(
|
||||
; CHECK-NEXT: [[A:%.*]] = call float @llvm.minnum.f32(float [[X:%.*]], float [[Y:%.*]])
|
||||
; CHECK-NEXT: [[B:%.*]] = call float @llvm.minnum.f32(float [[A]], float [[Y]])
|
||||
; CHECK-NEXT: ret float [[B]]
|
||||
;
|
||||
%a = call float @llvm.minnum.f32(float %x, float %y)
|
||||
%b = call float @llvm.minnum.f32(float %a, float %y)
|
||||
ret float %b
|
||||
}
|
||||
|
||||
define float @maxnum_x_maxnum_x_y(float %x, float %y) {
|
||||
; CHECK-LABEL: @maxnum_x_maxnum_x_y(
|
||||
; CHECK-NEXT: [[A:%.*]] = call float @llvm.maxnum.f32(float [[X:%.*]], float [[Y:%.*]])
|
||||
; CHECK-NEXT: [[B:%.*]] = call float @llvm.maxnum.f32(float [[X]], float [[A]])
|
||||
; CHECK-NEXT: ret float [[B]]
|
||||
;
|
||||
%a = call float @llvm.maxnum.f32(float %x, float %y)
|
||||
%b = call float @llvm.maxnum.f32(float %x, float %a)
|
||||
ret float %b
|
||||
}
|
||||
|
||||
define float @maxnum_y_maxnum_x_y(float %x, float %y) {
|
||||
; CHECK-LABEL: @maxnum_y_maxnum_x_y(
|
||||
; CHECK-NEXT: [[A:%.*]] = call float @llvm.maxnum.f32(float [[X:%.*]], float [[Y:%.*]])
|
||||
; CHECK-NEXT: [[B:%.*]] = call float @llvm.maxnum.f32(float [[Y]], float [[A]])
|
||||
; CHECK-NEXT: ret float [[B]]
|
||||
;
|
||||
%a = call float @llvm.maxnum.f32(float %x, float %y)
|
||||
%b = call float @llvm.maxnum.f32(float %y, float %a)
|
||||
ret float %b
|
||||
}
|
||||
|
||||
define float @maxnum_x_y_maxnum_x(float %x, float %y) {
|
||||
; CHECK-LABEL: @maxnum_x_y_maxnum_x(
|
||||
; CHECK-NEXT: [[A:%.*]] = call float @llvm.maxnum.f32(float [[X:%.*]], float [[Y:%.*]])
|
||||
; CHECK-NEXT: [[B:%.*]] = call float @llvm.maxnum.f32(float [[A]], float [[X]])
|
||||
; CHECK-NEXT: ret float [[B]]
|
||||
;
|
||||
%a = call float @llvm.maxnum.f32(float %x, float %y)
|
||||
%b = call float @llvm.maxnum.f32(float %a, float %x)
|
||||
ret float %b
|
||||
}
|
||||
|
||||
define float @maxnum_x_y_maxnum_y(float %x, float %y) {
|
||||
; CHECK-LABEL: @maxnum_x_y_maxnum_y(
|
||||
; CHECK-NEXT: [[A:%.*]] = call float @llvm.maxnum.f32(float [[X:%.*]], float [[Y:%.*]])
|
||||
; CHECK-NEXT: [[B:%.*]] = call float @llvm.maxnum.f32(float [[A]], float [[Y]])
|
||||
; CHECK-NEXT: ret float [[B]]
|
||||
;
|
||||
%a = call float @llvm.maxnum.f32(float %x, float %y)
|
||||
%b = call float @llvm.maxnum.f32(float %a, float %y)
|
||||
ret float %b
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue