llvm.org GIT mirror llvm / e36567e
[NFC][InstSimplify] Add more unary fneg tests to floating-point-arithmetic.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361076 91177308-0d34-0410-b5e6-96231b3b80d8 Cameron McInally 4 months ago
1 changed file(s) with 29 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
11 ; RUN: opt < %s -instsimplify -S | FileCheck %s
22
3 ; fneg (fneg X) ==> X
34 define float @fneg_fneg_var(float %a) {
45 ; CHECK-LABEL: @fneg_fneg_var(
56 ; CHECK-NEXT: ret float [[A:%.*]]
78 %r = fneg float %a
89 %r1 = fneg float %r
910 ret float %r1
11 }
12
13 ; fneg (fsub -0.0, X) ==> X
14 define float @fsub_-0_x(float %a) {
15 ; CHECK-LABEL: @fsub_-0_x(
16 ; CHECK-NEXT: ret float [[A:%.*]]
17 ;
18 %t1 = fsub float -0.0, %a
19 %ret = fneg float %t1
20 ret float %ret
21 }
22
23 define <2 x float> @fsub_-0_x_vec(<2 x float> %a) {
24 ; CHECK-LABEL: @fsub_-0_x_vec(
25 ; CHECK-NEXT: ret <2 x float> [[A:%.*]]
26 ;
27 %t1 = fsub <2 x float> , %a
28 %ret = fneg <2 x float> %t1
29 ret <2 x float> %ret
30 }
31
32 define <2 x float> @fsub_-0_x_vec_undef_elts(<2 x float> %a) {
33 ; CHECK-LABEL: @fsub_-0_x_vec_undef_elts(
34 ; CHECK-NEXT: ret <2 x float> [[A:%.*]]
35 ;
36 %t1 = fsub <2 x float> , %a
37 %ret = fneg <2 x float> %t1
38 ret <2 x float> %ret
1039 }
1140
1241 define <2 x float> @fsub_negzero_vec_undef_elts(<2 x float> %x) {