forked from OSchip/llvm-project
[NFC][InstSimplify] Add more unary fneg tests to floating-point-arithmetic.ll
llvm-svn: 361076
This commit is contained in:
parent
236317d216
commit
12de5425c1
|
@ -1,6 +1,7 @@
|
||||||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
||||||
; RUN: opt < %s -instsimplify -S | FileCheck %s
|
; RUN: opt < %s -instsimplify -S | FileCheck %s
|
||||||
|
|
||||||
|
; fneg (fneg X) ==> X
|
||||||
define float @fneg_fneg_var(float %a) {
|
define float @fneg_fneg_var(float %a) {
|
||||||
; CHECK-LABEL: @fneg_fneg_var(
|
; CHECK-LABEL: @fneg_fneg_var(
|
||||||
; CHECK-NEXT: ret float [[A:%.*]]
|
; CHECK-NEXT: ret float [[A:%.*]]
|
||||||
|
@ -10,6 +11,34 @@ define float @fneg_fneg_var(float %a) {
|
||||||
ret float %r1
|
ret float %r1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
; fneg (fsub -0.0, X) ==> X
|
||||||
|
define float @fsub_-0_x(float %a) {
|
||||||
|
; CHECK-LABEL: @fsub_-0_x(
|
||||||
|
; CHECK-NEXT: ret float [[A:%.*]]
|
||||||
|
;
|
||||||
|
%t1 = fsub float -0.0, %a
|
||||||
|
%ret = fneg float %t1
|
||||||
|
ret float %ret
|
||||||
|
}
|
||||||
|
|
||||||
|
define <2 x float> @fsub_-0_x_vec(<2 x float> %a) {
|
||||||
|
; CHECK-LABEL: @fsub_-0_x_vec(
|
||||||
|
; CHECK-NEXT: ret <2 x float> [[A:%.*]]
|
||||||
|
;
|
||||||
|
%t1 = fsub <2 x float> <float -0.0, float -0.0>, %a
|
||||||
|
%ret = fneg <2 x float> %t1
|
||||||
|
ret <2 x float> %ret
|
||||||
|
}
|
||||||
|
|
||||||
|
define <2 x float> @fsub_-0_x_vec_undef_elts(<2 x float> %a) {
|
||||||
|
; CHECK-LABEL: @fsub_-0_x_vec_undef_elts(
|
||||||
|
; CHECK-NEXT: ret <2 x float> [[A:%.*]]
|
||||||
|
;
|
||||||
|
%t1 = fsub <2 x float> <float -0.0, float undef>, %a
|
||||||
|
%ret = fneg <2 x float> %t1
|
||||||
|
ret <2 x float> %ret
|
||||||
|
}
|
||||||
|
|
||||||
define <2 x float> @fsub_negzero_vec_undef_elts(<2 x float> %x) {
|
define <2 x float> @fsub_negzero_vec_undef_elts(<2 x float> %x) {
|
||||||
; CHECK-LABEL: @fsub_negzero_vec_undef_elts(
|
; CHECK-LABEL: @fsub_negzero_vec_undef_elts(
|
||||||
; CHECK-NEXT: ret <2 x float> [[X:%.*]]
|
; CHECK-NEXT: ret <2 x float> [[X:%.*]]
|
||||||
|
|
Loading…
Reference in New Issue