1 ; Test that llvm-reduce can reduce floating point operands
3 ; RUN: llvm-reduce --abort-on-invalid-reduction --delta-passes=operands-one --test FileCheck --test-arg --check-prefixes=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t
4 ; RUN: FileCheck --check-prefixes=CHECK,ONE %s < %t
6 ; RUN: llvm-reduce --abort-on-invalid-reduction --delta-passes=operands-zero --test FileCheck --test-arg --check-prefixes=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t
7 ; RUN: FileCheck --check-prefixes=CHECK,ZERO %s < %t
9 ; RUN: llvm-reduce --abort-on-invalid-reduction --delta-passes=operands-nan --test FileCheck --test-arg --check-prefixes=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t
10 ; RUN: FileCheck --check-prefixes=CHECK,NAN %s < %t
12 ; RUN: llvm-reduce --abort-on-invalid-reduction --test FileCheck --test-arg --check-prefixes=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t
13 ; RUN: FileCheck --check-prefixes=CHECK,ZERO %s < %t
15 ; CHECK-INTERESTINGNESS: = fadd float %
16 ; CHECK-INTERESTINGNESS: = fadd float
17 ; CHECK-INTERESTINGNESS: = fadd float
18 ; CHECK-INTERESTINGNESS: = fadd float
19 ; CHECK-INTERESTINGNESS: = fadd float
20 ; CHECK-INTERESTINGNESS: = fadd float
22 ; CHECK-INTERESTINGNESS: = fadd <2 x float> %
23 ; CHECK-INTERESTINGNESS: = fadd <2 x float>
24 ; CHECK-INTERESTINGNESS: = fadd <2 x float>
25 ; CHECK-INTERESTINGNESS: = fadd <2 x float>
26 ; CHECK-INTERESTINGNESS: = fadd <2 x float>
27 ; CHECK-INTERESTINGNESS: = fadd <2 x float>
28 ; CHECK-INTERESTINGNESS: = fadd <2 x float>
30 ; CHECK-LABEL: define void @foo(
33 ; ONE: %fadd0 = fadd float %arg0, 1.000000e+00
34 ; ONE: %fadd1 = fadd float 1.000000e+00, 1.000000e+00
35 ; ONE: %fadd2 = fadd float 1.000000e+00, 0.000000e+00
36 ; ONE: %fadd3 = fadd float 1.000000e+00, 1.000000e+00
37 ; ONE: %fadd4 = fadd float 1.000000e+00, 1.000000e+00
38 ; ONE: %fadd5 = fadd float 1.000000e+00, 1.000000e+00
39 ; ONE: %fadd6 = fadd <2 x float> %arg2, <float 1.000000e+00, float 1.000000e+00>
40 ; ONE: %fadd7 = fadd <2 x float> <float 1.000000e+00, float 1.000000e+00>, <float 1.000000e+00, float 1.000000e+00>
41 ; ONE: %fadd8 = fadd <2 x float> <float 1.000000e+00, float 1.000000e+00>, zeroinitializer
42 ; ONE: %fadd9 = fadd <2 x float> <float 1.000000e+00, float 1.000000e+00>, <float 1.000000e+00, float 1.000000e+00>
43 ; ONE: %fadd10 = fadd <2 x float> <float 1.000000e+00, float 1.000000e+00>, <float 1.000000e+00, float 1.000000e+00>
44 ; ONE: %fadd11 = fadd <2 x float> <float 1.000000e+00, float 1.000000e+00>, <float 1.000000e+00, float 1.000000e+00>
45 ; ONE: %fadd12 = fadd <2 x float> <float 1.000000e+00, float 1.000000e+00>, <float 1.000000e+00, float 1.000000e+00>
48 ; ZERO: %fadd0 = fadd float %arg0, 0.000000e+00
49 ; ZERO: %fadd1 = fadd float 0.000000e+00, 0.000000e+00
50 ; ZERO: %fadd2 = fadd float 0.000000e+00, 0.000000e+00
51 ; ZERO: %fadd3 = fadd float 0.000000e+00, 0.000000e+00
52 ; ZERO: %fadd4 = fadd float 0.000000e+00, 0.000000e+00
53 ; ZERO: %fadd5 = fadd float 0.000000e+00, 0.000000e+00
54 ; ZERO: %fadd6 = fadd <2 x float> %arg2, zeroinitializer
55 ; ZERO: %fadd7 = fadd <2 x float> zeroinitializer, zeroinitializer
56 ; ZERO: %fadd8 = fadd <2 x float> zeroinitializer, zeroinitializer
57 ; ZERO: %fadd9 = fadd <2 x float> zeroinitializer, zeroinitializer
58 ; ZERO: %fadd10 = fadd <2 x float> zeroinitializer, zeroinitializer
59 ; ZERO: %fadd11 = fadd <2 x float> zeroinitializer, zeroinitializer
60 ; ZERO: %fadd12 = fadd <2 x float> zeroinitializer, zeroinitializer
63 ; NAN: %fadd0 = fadd float %arg0, 0x7FF8000000000000
64 ; NAN: %fadd1 = fadd float 0x7FF8000000000000, 0x7FF8000000000000
65 ; NAN: %fadd2 = fadd float 0x7FF8000000000000, 0.000000e+00
66 ; NAN: %fadd3 = fadd float 0x7FF8000000000000, 1.000000e+00
67 ; NAN: %fadd4 = fadd float 0x7FF8000000000000, 0x7FF8000000000000
68 ; NAN: %fadd5 = fadd float 0x7FF8000000000000, 0x7FF8000000000000
69 ; NAN: %fadd6 = fadd <2 x float> %arg2, <float 0x7FF8000000000000, float 0x7FF8000000000000>
70 ; NAN: %fadd7 = fadd <2 x float> <float 0x7FF8000000000000, float 0x7FF8000000000000>, <float 0x7FF8000000000000, float 0x7FF8000000000000>
71 ; NAN: %fadd8 = fadd <2 x float> <float 0x7FF8000000000000, float 0x7FF8000000000000>, zeroinitializer
72 ; NAN: %fadd9 = fadd <2 x float> <float 0x7FF8000000000000, float 0x7FF8000000000000>, <float 1.000000e+00, float 1.000000e+00>
73 ; NAN: %fadd10 = fadd <2 x float> <float 0x7FF8000000000000, float 0x7FF8000000000000>, <float 0x7FF8000000000000, float 0x7FF8000000000000>
74 ; NAN: %fadd11 = fadd <2 x float> <float 0x7FF8000000000000, float 0x7FF8000000000000>, <float 0x7FF8000000000000, float 0x7FF8000000000000>
75 ; NAN: %fadd12 = fadd <2 x float> <float 0x7FF8000000000000, float 0x7FF8000000000000>, <float 0x7FF8000000000000, float 0x7FF8000000000000>
77 define void @foo(float %arg0, float %arg1, <2 x float> %arg2, <2 x float> %arg3) {
79 %fadd0 = fadd float %arg0, %arg1
80 %fadd1 = fadd float %arg0, %arg1
81 %fadd2 = fadd float %arg0, 0.0
82 %fadd3 = fadd float %arg0, 1.0
83 %fadd4 = fadd float %arg0, 0x7FF8000000000000
84 %fadd5 = fadd float %arg0, undef
85 %fadd6 = fadd <2 x float> %arg2, %arg3
86 %fadd7 = fadd <2 x float> %arg2, %arg3
87 %fadd8 = fadd <2 x float> %arg2, zeroinitializer
88 %fadd9 = fadd <2 x float> %arg2, <float 1.0, float 1.0>
89 %fadd10 = fadd <2 x float> %arg2, undef
90 %fadd11 = fadd <2 x float> %arg2, <float 0x7FF8000000000000, float 0x7FF8000000000000>
91 %fadd12 = fadd <2 x float> %arg2, <float 0x7FF8000000000000, float 2.0>