1
1
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2
- ; RUN: llc < %s -mtriple=x86_64-unknown-unknown --fp-contract=fast -- enable-no-signed-zeros-fp-math -mattr=avx512fp16,avx512vl | FileCheck %s --check-prefixes=CHECK,NO-SZ
3
- ; RUN: llc < %s -mtriple=x86_64-unknown-unknown --fp-contract=fast - mattr=avx512fp16,avx512vl | FileCheck %s --check-prefixes=CHECK,HAS-SZ
2
+ ; RUN: llc < %s -mtriple=x86_64-unknown-unknown --enable-no-signed-zeros-fp-math -mattr=avx512fp16,avx512vl | FileCheck %s --check-prefixes=CHECK,NO-SZ
3
+ ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=avx512fp16,avx512vl | FileCheck %s --check-prefixes=CHECK,HAS-SZ
4
4
5
5
; FADD(acc, FMA(a, b, +0.0)) can be combined to FMA(a, b, acc) if the nsz flag set.
6
6
define dso_local <32 x half > @test1 (<32 x half > %acc , <32 x half > %a , <32 x half > %b ) {
@@ -18,9 +18,9 @@ define dso_local <32 x half> @test1(<32 x half> %acc, <32 x half> %a, <32 x half
18
18
entry:
19
19
%0 = bitcast <32 x half > %a to <16 x float >
20
20
%1 = bitcast <32 x half > %b to <16 x float >
21
- %2 = tail call <16 x float > @llvm.x86.avx512fp16.mask.vfcmadd.cph.512 (<16 x float > %0 , <16 x float > %1 , <16 x float > zeroinitializer , i16 -1 , i32 4 )
21
+ %2 = tail call contract <16 x float > @llvm.x86.avx512fp16.mask.vfcmadd.cph.512 (<16 x float > %0 , <16 x float > %1 , <16 x float > zeroinitializer , i16 -1 , i32 4 )
22
22
%3 = bitcast <16 x float > %2 to <32 x half >
23
- %add.i = fadd <32 x half > %3 , %acc
23
+ %add.i = fadd contract <32 x half > %3 , %acc
24
24
ret <32 x half > %add.i
25
25
}
26
26
@@ -39,9 +39,9 @@ define dso_local <32 x half> @test2(<32 x half> %acc, <32 x half> %a, <32 x half
39
39
entry:
40
40
%0 = bitcast <32 x half > %a to <16 x float >
41
41
%1 = bitcast <32 x half > %b to <16 x float >
42
- %2 = tail call <16 x float > @llvm.x86.avx512fp16.mask.vfmadd.cph.512 (<16 x float > %0 , <16 x float > %1 , <16 x float > zeroinitializer , i16 -1 , i32 4 )
42
+ %2 = tail call contract <16 x float > @llvm.x86.avx512fp16.mask.vfmadd.cph.512 (<16 x float > %0 , <16 x float > %1 , <16 x float > zeroinitializer , i16 -1 , i32 4 )
43
43
%3 = bitcast <16 x float > %2 to <32 x half >
44
- %add.i = fadd <32 x half > %3 , %acc
44
+ %add.i = fadd contract <32 x half > %3 , %acc
45
45
ret <32 x half > %add.i
46
46
}
47
47
@@ -60,9 +60,9 @@ define dso_local <16 x half> @test3(<16 x half> %acc, <16 x half> %a, <16 x half
60
60
entry:
61
61
%0 = bitcast <16 x half > %a to <8 x float >
62
62
%1 = bitcast <16 x half > %b to <8 x float >
63
- %2 = tail call <8 x float > @llvm.x86.avx512fp16.mask.vfcmadd.cph.256 (<8 x float > %0 , <8 x float > %1 , <8 x float > zeroinitializer , i8 -1 )
63
+ %2 = tail call contract <8 x float > @llvm.x86.avx512fp16.mask.vfcmadd.cph.256 (<8 x float > %0 , <8 x float > %1 , <8 x float > zeroinitializer , i8 -1 )
64
64
%3 = bitcast <8 x float > %2 to <16 x half >
65
- %add.i = fadd <16 x half > %3 , %acc
65
+ %add.i = fadd contract <16 x half > %3 , %acc
66
66
ret <16 x half > %add.i
67
67
}
68
68
@@ -81,9 +81,9 @@ define dso_local <16 x half> @test4(<16 x half> %acc, <16 x half> %a, <16 x half
81
81
entry:
82
82
%0 = bitcast <16 x half > %a to <8 x float >
83
83
%1 = bitcast <16 x half > %b to <8 x float >
84
- %2 = tail call <8 x float > @llvm.x86.avx512fp16.mask.vfmadd.cph.256 (<8 x float > %0 , <8 x float > %1 , <8 x float > zeroinitializer , i8 -1 )
84
+ %2 = tail call contract <8 x float > @llvm.x86.avx512fp16.mask.vfmadd.cph.256 (<8 x float > %0 , <8 x float > %1 , <8 x float > zeroinitializer , i8 -1 )
85
85
%3 = bitcast <8 x float > %2 to <16 x half >
86
- %add.i = fadd <16 x half > %3 , %acc
86
+ %add.i = fadd contract <16 x half > %3 , %acc
87
87
ret <16 x half > %add.i
88
88
}
89
89
@@ -102,9 +102,9 @@ define dso_local <8 x half> @test5(<8 x half> %acc, <8 x half> %a, <8 x half> %b
102
102
entry:
103
103
%0 = bitcast <8 x half > %a to <4 x float >
104
104
%1 = bitcast <8 x half > %b to <4 x float >
105
- %2 = tail call <4 x float > @llvm.x86.avx512fp16.mask.vfcmadd.cph.128 (<4 x float > %0 , <4 x float > %1 , <4 x float > zeroinitializer , i8 -1 )
105
+ %2 = tail call contract <4 x float > @llvm.x86.avx512fp16.mask.vfcmadd.cph.128 (<4 x float > %0 , <4 x float > %1 , <4 x float > zeroinitializer , i8 -1 )
106
106
%3 = bitcast <4 x float > %2 to <8 x half >
107
- %add.i = fadd <8 x half > %3 , %acc
107
+ %add.i = fadd contract <8 x half > %3 , %acc
108
108
ret <8 x half > %add.i
109
109
}
110
110
@@ -123,9 +123,9 @@ define dso_local <8 x half> @test6(<8 x half> %acc, <8 x half> %a, <8 x half> %b
123
123
entry:
124
124
%0 = bitcast <8 x half > %a to <4 x float >
125
125
%1 = bitcast <8 x half > %b to <4 x float >
126
- %2 = tail call <4 x float > @llvm.x86.avx512fp16.mask.vfmadd.cph.128 (<4 x float > %0 , <4 x float > %1 , <4 x float > zeroinitializer , i8 -1 )
126
+ %2 = tail call contract <4 x float > @llvm.x86.avx512fp16.mask.vfmadd.cph.128 (<4 x float > %0 , <4 x float > %1 , <4 x float > zeroinitializer , i8 -1 )
127
127
%3 = bitcast <4 x float > %2 to <8 x half >
128
- %add.i = fadd <8 x half > %3 , %acc
128
+ %add.i = fadd contract <8 x half > %3 , %acc
129
129
ret <8 x half > %add.i
130
130
}
131
131
@@ -138,9 +138,9 @@ define dso_local <32 x half> @test13(<32 x half> %acc, <32 x half> %a, <32 x hal
138
138
entry:
139
139
%0 = bitcast <32 x half > %a to <16 x float >
140
140
%1 = bitcast <32 x half > %b to <16 x float >
141
- %2 = tail call <16 x float > @llvm.x86.avx512fp16.mask.vfcmadd.cph.512 (<16 x float > %0 , <16 x float > %1 , <16 x float > <float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 >, i16 -1 , i32 4 )
141
+ %2 = tail call contract <16 x float > @llvm.x86.avx512fp16.mask.vfcmadd.cph.512 (<16 x float > %0 , <16 x float > %1 , <16 x float > <float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 >, i16 -1 , i32 4 )
142
142
%3 = bitcast <16 x float > %2 to <32 x half >
143
- %add.i = fadd <32 x half > %3 , %acc
143
+ %add.i = fadd contract <32 x half > %3 , %acc
144
144
ret <32 x half > %add.i
145
145
}
146
146
@@ -152,9 +152,9 @@ define dso_local <32 x half> @test14(<32 x half> %acc, <32 x half> %a, <32 x hal
152
152
entry:
153
153
%0 = bitcast <32 x half > %a to <16 x float >
154
154
%1 = bitcast <32 x half > %b to <16 x float >
155
- %2 = tail call <16 x float > @llvm.x86.avx512fp16.mask.vfmadd.cph.512 (<16 x float > %0 , <16 x float > %1 , <16 x float > <float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 >, i16 -1 , i32 4 )
155
+ %2 = tail call contract <16 x float > @llvm.x86.avx512fp16.mask.vfmadd.cph.512 (<16 x float > %0 , <16 x float > %1 , <16 x float > <float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 >, i16 -1 , i32 4 )
156
156
%3 = bitcast <16 x float > %2 to <32 x half >
157
- %add.i = fadd <32 x half > %3 , %acc
157
+ %add.i = fadd contract <32 x half > %3 , %acc
158
158
ret <32 x half > %add.i
159
159
}
160
160
@@ -166,9 +166,9 @@ define dso_local <16 x half> @test15(<16 x half> %acc, <16 x half> %a, <16 x hal
166
166
entry:
167
167
%0 = bitcast <16 x half > %a to <8 x float >
168
168
%1 = bitcast <16 x half > %b to <8 x float >
169
- %2 = tail call <8 x float > @llvm.x86.avx512fp16.mask.vfcmadd.cph.256 (<8 x float > %0 , <8 x float > %1 , <8 x float > <float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 >, i8 -1 )
169
+ %2 = tail call contract <8 x float > @llvm.x86.avx512fp16.mask.vfcmadd.cph.256 (<8 x float > %0 , <8 x float > %1 , <8 x float > <float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 >, i8 -1 )
170
170
%3 = bitcast <8 x float > %2 to <16 x half >
171
- %add.i = fadd <16 x half > %3 , %acc
171
+ %add.i = fadd contract <16 x half > %3 , %acc
172
172
ret <16 x half > %add.i
173
173
}
174
174
@@ -180,9 +180,9 @@ define dso_local <16 x half> @test16(<16 x half> %acc, <16 x half> %a, <16 x hal
180
180
entry:
181
181
%0 = bitcast <16 x half > %a to <8 x float >
182
182
%1 = bitcast <16 x half > %b to <8 x float >
183
- %2 = tail call <8 x float > @llvm.x86.avx512fp16.mask.vfmadd.cph.256 (<8 x float > %0 , <8 x float > %1 , <8 x float > <float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 >, i8 -1 )
183
+ %2 = tail call contract <8 x float > @llvm.x86.avx512fp16.mask.vfmadd.cph.256 (<8 x float > %0 , <8 x float > %1 , <8 x float > <float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 >, i8 -1 )
184
184
%3 = bitcast <8 x float > %2 to <16 x half >
185
- %add.i = fadd <16 x half > %3 , %acc
185
+ %add.i = fadd contract <16 x half > %3 , %acc
186
186
ret <16 x half > %add.i
187
187
}
188
188
@@ -194,9 +194,9 @@ define dso_local <8 x half> @test17(<8 x half> %acc, <8 x half> %a, <8 x half> %
194
194
entry:
195
195
%0 = bitcast <8 x half > %a to <4 x float >
196
196
%1 = bitcast <8 x half > %b to <4 x float >
197
- %2 = tail call <4 x float > @llvm.x86.avx512fp16.mask.vfcmadd.cph.128 (<4 x float > %0 , <4 x float > %1 , <4 x float > <float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 >, i8 -1 )
197
+ %2 = tail call contract <4 x float > @llvm.x86.avx512fp16.mask.vfcmadd.cph.128 (<4 x float > %0 , <4 x float > %1 , <4 x float > <float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 >, i8 -1 )
198
198
%3 = bitcast <4 x float > %2 to <8 x half >
199
- %add.i = fadd <8 x half > %3 , %acc
199
+ %add.i = fadd contract <8 x half > %3 , %acc
200
200
ret <8 x half > %add.i
201
201
}
202
202
@@ -208,9 +208,9 @@ define dso_local <8 x half> @test18(<8 x half> %acc, <8 x half> %a, <8 x half> %
208
208
entry:
209
209
%0 = bitcast <8 x half > %a to <4 x float >
210
210
%1 = bitcast <8 x half > %b to <4 x float >
211
- %2 = tail call <4 x float > @llvm.x86.avx512fp16.mask.vfmadd.cph.128 (<4 x float > %0 , <4 x float > %1 , <4 x float > <float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 >, i8 -1 )
211
+ %2 = tail call contract <4 x float > @llvm.x86.avx512fp16.mask.vfmadd.cph.128 (<4 x float > %0 , <4 x float > %1 , <4 x float > <float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 , float 0xB790000000000000 >, i8 -1 )
212
212
%3 = bitcast <4 x float > %2 to <8 x half >
213
- %add.i = fadd <8 x half > %3 , %acc
213
+ %add.i = fadd contract <8 x half > %3 , %acc
214
214
ret <8 x half > %add.i
215
215
}
216
216
0 commit comments