1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
|
2020-08-03 Martin Jambor <mjambor@suse.cz>
* brigfrontend/brig-util.h (hsa_type_packed_p): Declared.
* brigfrontend/brig-util.cc (hsa_type_packed_p): Moved here from
removed gcc/hsa-common.c.
* brigfrontend/hsa-brig-format.h: New file.
2020-01-01 Jakub Jelinek <jakub@redhat.com>
Update copyright years.
2019-10-04 Joseph Myers <joseph@codesourcery.com>
* brig-lang.c (flag_isoc2x): New variable.
2019-08-23 Jakub Jelinek <jakub@redhat.com>
PR middle-end/91283
* brig-lang.c (brig_langhook_post_options): Set flag_excess_precision
instead of flag_excess_precision_cmdline.
2019-06-25 Jozef Lawrynowicz <jozef.l@mittosystems.com>
* brig-lang.c (brig_build_c_type_nodes): Accept "__intN__"
format of "__intN" types for SIZE_TYPE.
2019-05-16 Martin Sebor <msebor@redhat.com>
* brigfrontend/brig-control-handler.cc
(brig_directive_control_handler::operator): Remove trailing newline
from a diagnostic.
* brigfrontend/brig-module-handler.cc
(brig_directive_module_handler::operator): Remove a duplicated space
from a diagnostic.
2019-01-01 Jakub Jelinek <jakub@redhat.com>
Update copyright years.
2018-10-17 David Malcolm <dmalcolm@redhat.com>
* Make-lang.in (selftest-brig): New.
2018-07-20 Martin Sebor <msebor@redhat.com>
PR middle-end/82063
* brig-lang.c (brig_langhook_handle_option): Change function
argument to HOST_WIDE_INT.
2018-07-04 Martin Jambor <mjambor@suse.cz>
PR hsa/86371
* Make-lang.in (BRIGINCLUDES): Remove erroneous include path in $HOME.
2018-06-28 Martin Liska <mliska@suse.cz>
* brigspec.c: Add missing header file inclusion.
2018-06-08 David Malcolm <dmalcolm@redhat.com>
* brigfrontend/brig-to-generic.cc
(brig_to_generic::write_globals): Use TDF_NONE rather than 0.
(dump_function): Likewise.
2018-05-18 Richard Sandiford <richard.sandiford@linaro.org>
* brigfrontend/brig-function.cc
(brig_function::get_builtin_for_hsa_opcode): Use BUILT_IN_FMA
for BRIG_OPCODE_FMA.
(brig_function::get_tree_code_for_hsa_opcode): Treat BUILT_IN_FMA
as a call.
2018-05-04 Pekka Jääskeläinen <pekka.jaaskelainen@parmance.com>
* brigfrontend/brig-basic-inst-handler.cc: Fix handling of NOPs.
2018-05-04 Pekka Jääskeläinen <pekka.jaaskelainen@parmance.com>
Add flag -fassume-phsa that is on by default. If -fno-assume-phsa
is given, these optimizations are disabled. With this flag, gccbrig
can generate GENERIC that assumes we are targeting a phsa-runtime
based implementation, which allows us to expose the work-item context
accesses to retrieve WI IDs etc. which helps optimizers.
First optimization that takes advantage of this is to get rid of
the setworkitemid calls whenever we have non-inlined calls that
use IDs internally. Other optimizations added in this commit:
- expand absoluteid to similar level of simplicity as workitemid.
At the moment absoluteid is the best indexing ID to end up with
WG vectorization.
- propagate ID variables closer to their uses. This is mainly
to avoid known useless casts, which confuse at least scalar
evolution analysis.
- use signed long long for storing IDs. Unsigned integers have
defined wraparound semantics, which confuse at least scalar
evolution analysis, leading to unvectorizable WI loops.
- also refactor some BRIG function generation helpers to brig_function.
- no point in having the wi-loop as a for-loop. It's really
a do...while and SCEV can analyze it just fine still.
- add consts to ptrs etc. in BRIG builtin defs.
Improves optimization opportunities.
- add qualifiers to generated function parameters.
Const and restrict on the hidden local/private pointers,
the arg buffer and the context pointer help some optimizations.
* brigfrontend/brig-basic-inst-handler.cc: See above.
* brigfrontend/brig-branch-inst-handler.cc: See above.
* brigfrontend/brig-cmp-inst-handler.cc: See above.
* brigfrontend/brig-code-entry-handler.cc: See above.
* brigfrontend/brig-code-entry-handler.h: See above.
* brigfrontend/brig-control-handler.cc: See above.
* brigfrontend/brig-cvt-inst-handler.cc: See above.
* brigfrontend/brig-function-handler.cc: See above.
* brigfrontend/brig-function.cc: See above.
* brigfrontend/brig-function.h: See above.
* brigfrontend/brig-label-handler.cc: See above.
* brigfrontend/brig-lane-inst-handler.cc: See above.
* brigfrontend/brig-mem-inst-handler.cc: See above.
* brigfrontend/phsa.h: See above.
* lang.opt: See above.
2018-05-04 Pekka Jääskeläinen <pekka.jaaskelainen@parmance.com>
* brigfrontend/brig-function-handler.cc: Skip multiple forward
declarations of the same function.
2018-05-04 Pekka Jääskeläinen <pekka.jaaskelainen@parmance.com>
* brig-lang.c: Do not allow optimizations based on known C
builtins.
2018-05-04 Pekka Jääskeläinen <pekka.jaaskelainen@parmance.com>
* brig-lang.c: Allow controlling strict aliasing from
cmd line.
2018-05-04 Pekka Jääskeläinen <pekka.jaaskelainen@parmance.com>
* brigfrontend/brig-code-entry-handler.cc: The modulo in
ID computation should not be needed.
2018-05-04 Pekka Jääskeläinen <pekka.jaaskelainen@parmance.com>
* brig-lang.c: Add support for whole program
optimizations by marking the kernels externally visible.
* brigfrontend/brig-branch-inst-handler.cc: See above.
* brigfrontend/brig-function-handler.cc: See above.
* brigfrontend/brig-function.cc: See above.
* brigfrontend/brig-to-generic.cc: See above.
* brigfrontend/brig-to-generic.h: See above.
* brigfrontend/brig-variable-handler.h: See above.
2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
* brigfrontend/brig-to-generic.cc (get_unsigned_int_type): Handle
polynomial TYPE_VECTOR_SUBPARTS.
* brigfrontend/brig-util.h (gccbrig_type_vector_subparts): Likewise.
2018-01-03 Jakub Jelinek <jakub@redhat.com>
Update copyright years.
2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
* brigfrontend/brig-util.h (gccbrig_type_vector_subparts): New
function.
* brigfrontend/brig-basic-inst-handler.cc
(brig_basic_inst_handler::build_shuffle): Use it instead of
TYPE_VECTOR_SUBPARTS.
(brig_basic_inst_handler::build_unpack): Likewise.
(brig_basic_inst_handler::build_pack): Likewise.
(brig_basic_inst_handler::build_unpack_lo_or_hi): Likewise.
(brig_basic_inst_handler::operator ()): Likewise.
(brig_basic_inst_handler::build_lower_element_broadcast): Likewise.
* brigfrontend/brig-code-entry-handler.cc
(brig_code_entry_handler::get_tree_cst_for_hsa_operand): Likewise.
(brig_code_entry_handler::get_comparison_result_type): Likewise.
(brig_code_entry_handler::expand_or_call_builtin): Likewise.
2017-12-15 Jakub Jelinek <jakub@redhat.com>
* brig-lang.c (brig_attribute_table): Swap affects_type_identity
and handler fields, adjust comments.
2017-12-08 Jakub Jelinek <jakub@redhat.com>
* brig-lang.c (brig_attribute_table): Fix up comment.
2017-11-28 Jakub Jelinek <jakub@redhat.com>
* brigfrontend/brig-branch-inst-handler.cc
(brig_branch_inst_handler::operator): Build SWITCH_EXPR using build2
instead of build3.
2017-11-17 Henry Linjamäki <henry.linjamaki@parmance.com>
* brigfrontend/brig-util.cc: Fix sprintf format string type mismatch
on 32b machines.
2017-11-16 Henry Linjamäki <henry.linjamaki@parmance.com>
Change internal representation of HSA registers. Instead
representing HSA's untyped registers as unsigned int the gccbrig
analyzes brig code and builds the register variables as a type
used in tree expressions at most. This gives better chance to
optimize CONVERT_VIEW_EXPRs away.
* brigfrontend/brig-code-entry-handler.cc: Add analysis method for
register type usage. Handle any-typed register variables.
* brigfrontend/brig-code-entry-handler.h: New declarations for the
above.
* brigfrontend/brig-copy-move-inst-handler.cc: Handle any-typed
register variables.
* brigfrontend/brig-cvt-inst-handler.cc: Likewise.
* brigfrontend/brig-function.cc: Build register variables as a
type based on results of analysis phase.
* brigfrontend/brig-function.h: Move HSA register count defines to
brig-utils.h.
* brigfrontend/brig-to-generic.cc: New analysis handler. Analyze
HSA register usage.
* brigfrontend/brig-to-generic.h: New declarations.
* brigfrontend/brig-util.cc: New utility functions.
* brigfrontend/brig-util.h: New declarations for the above.
2017-11-16 Pekka Jääskeläinen <pekka.jaaskelainen@parmance.com>
* gccbrig.texi: Added some documentation.
2017-10-31 Henry Linjamäki <henry.linjamaki@parmance.com>
* brig-lang.c (brig_langhook_type_for_mode): Fix PR 82771.
2017-10-23 Richard Sandiford <richard.sandiford@linaro.org>
* brig-lang.c (brig_langhook_type_for_mode): Use scalar_int_mode
and scalar_float_mode.
2017-10-09 Pekka Jääskeläinen <pekka.jaaskelainen@parmance.com>
* brigfrontend/brig-to-generic.cc: Support BRIG_KIND_NONE
directives. These directives are legal everywhere. They
can be used to patch away BRIG entries at the binary level.
Also add extra error detection for zeroed regions: make sure
the byteCount field is never zero.
* brigfrontend/phsa.h: Added a new error prefix for
errors which are due to corrupted BRIG modules.
2017-10-09 Henry Linjamäki <henry.linjamaki@parmance.com>
* brigfrontend/brig-branch-inst-handler.cc: The call code
still failed a few test cases. Now all PRM cases pass again.
2017-10-03 Henry Linjamäki <henry.linjamaki@parmance.com>
* brigfrontend/brig-branch-inst-handler.cc: Fix (more) crash with
calls with more than 4 args. It missed a reference which is required
because vector expansion can move the object to another location.
2017-09-29 Henry Linjamäki <henry.linjamaki@parmance.com>
* brigfrontend/brig-branch-inst-handler.cc: Fix crash with
calls with more than 4 args. Also fix a misexecution issue
with kernels that have both unexpanded ID functions and
calls to subfunctions.
2017-09-28 Henry Linjamäki <henry.linjamaki@parmance.com>
* brig-lang.c: Added function attributes and their handlers.
Make BRIGFE 3-level optimize by default.
2017-09-27 Pekka Jääskeläinen <pekka.jaaskelainen@parmance.com>
* brig-lang.c: Improved support for function and module scope
group segment variables. PRM specs defines function and module
scope group segment variables as an experimental feature. However,
PRM test suite uses and hcc relies on them. In addition, hcc
assumes certain group variable layout in its dynamic group segment
allocation code. We cannot have global group memory offsets if we
want to both have kernel-specific group segment size and multiple
kernels calling the same functions that use function scope group memory
variables. Now group segment is handled by separate book keeping of
module scope and function (kernel) offsets. Each function has a "frame"
in the group segment offset to which is given as an argument.
* brigfrontend/brig-branch-inst-handler.cc: See above.
* brigfrontend/brig-code-entry-handler.cc: See above.
* brigfrontend/brig-fbarrier-handler.cc: See above.
* brigfrontend/brig-function-handler.cc: See above.
* brigfrontend/brig-function.cc: See above.
* brigfrontend/brig-function.h: See above.
* brigfrontend/brig-to-generic.cc: See above.
* brigfrontend/brig-to-generic.h: See above.
* brigfrontend/brig-util.cc: See above.
* brigfrontend/brig-util.h: See above.
* brigfrontend/brig-variable-handler.cc: See above.
2017-09-25 Pekka Jääskeläinen <pekka.jaaskelainen@parmance.com>
* brigfrontend/brig-to-generic.cc: Ensure per WI copies of
private variables are aligned too.
2017-09-17 Thomas Schwinge <thomas@codesourcery.com>
* Make-lang.in (GO_TEXI_FILES): Rename to...
(BRIG_TEXI_FILES): ... this.
(doc/gccbrig.info, doc/gccbrig.dvi, doc/gccbrig.pdf, brig.info)
(brig.srcinfo, brig.man, brig.srcman, brig.install-man)
($(DESTDIR)$(man1dir)/$(GCCBRIG_INSTALL_NAME)$(man1ext)):
Uncomment/enable targets.
(gccbrig.pod): New target.
* gccbrig.texi: New file.
2017-08-04 Henry Linjamäki <henry.linjamaki@parmance.com>
Fix PR 81713
* brigfrontend/brig-basic-inst-handler.cc: replace build_int_cst with
bitsize_int in building BIT_FIELD_REF.
* brigfrontend/brig-code-entry-handler.cc: likewise.
2017-07-05 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
* brig-c.h (brig_type_for_mode): Remove "enum" before "machine_mode".
* brig-lang.c (brig_langhook_type_for_mode): Likewise.
2017-07-04 Jakub Jelinek <jakub@redhat.com>
* brigfrontend/brig-function.cc: Include profile-count.h.
* brigfrontend/brig-to-generic.cc: Likewise.
2017-05-18 Thomas Schwinge <thomas@codesourcery.com>
* brigfrontend/brig-to-generic.h (class brig_to_generic): Use
"dump_flags_t" for "m_dump_flags" member.
2017-05-13 Pekka Jääskeläinen <pekka.jaaskelainen@parmance.com>
* brigfrontend/brig-code-entry-handler.cc
(brig_code_entry_handler::build_address_operand): Fix
an assertion when doing an 'lda' of a private array
offset.
2017-05-03 Pekka Jääskeläinen <pekka.jaaskelainen@parmance.com>
* brigfrontend/brig-code-entry-handler.cc
(brig_code_entry_handler::build_address_operand): Fix a bug
with reg+offset addressing on 32b segments. In large mode,
the offset is treated as 32bits unless it's global, readonly or
kernarg address space.
2016-02-01 Pekka Jääskeläinen <pekka.jaaskelainen@parmance.com>
* brigfrontend/brig-code-entry-handler.cc: fix address
expressions which refer only to offset 0, but nothing else.
* brigfrontend/brig-lane-inst-handler.cc: fix
activelanepermute_b64 HSAIL instruction.
* brigfrontend/brig-to-generic.cc: remove useless c_str()
call. Add missing va_end (). Fix PR79250.
2017-01-30 Jakub Jelinek <jakub@redhat.com>
* brigfrontend/brig-code-entry-handler.cc
(brig_code_entry_handler::get_tree_cst_for_hsa_operand): For %lu
cast size_t arguments to unsigned long.
2017-01-27 Pekka Jääskeläinen <pekka.jaaskelainen@parmance.com>
* config-lang.in: Removed stale target-libbrig reference.
2017-01-26 Jakub Jelinek <jakub@redhat.com>
Update copyright years.
2017-01-24 Pekka Jääskeläinen <pekka@parmance.com>
Martin Jambor <mjambor@suse.cz>
* Make-lang.in: New file.
* brig-builtins.h: Likewise.
* brig-c.h: Likewise.
* brig-lang.c: Likewise.
* brigspec.c: Likewise.
* config-lang.in: Likewise.
* lang-specs.h: Likewise.
* lang.opt: Likewise.
* brigfrontend/brig-arg-block-handler.cc: Likewise.
* brigfrontend/brig-atomic-inst-handler.cc: Likewise.
* brigfrontend/brig-basic-inst-handler.cc: Likewise.
* brigfrontend/brig-branch-inst-handler.cc: Likewise.
* brigfrontend/brig-cmp-inst-handler.cc: Likewise.
* brigfrontend/brig-code-entry-handler.cc: Likewise.
* brigfrontend/brig-code-entry-handler.h: Likewise.
* brigfrontend/brig-comment-handler.cc: Likewise.
* brigfrontend/brig-control-handler.cc: Likewise.
* brigfrontend/brig-copy-move-inst-handler.cc: Likewise.
* brigfrontend/brig-cvt-inst-handler.cc: Likewise.
* brigfrontend/brig-fbarrier-handler.cc: Likewise.
* brigfrontend/brig-function-handler.cc: Likewise.
* brigfrontend/brig-function.cc: Likewise.
* brigfrontend/brig-function.h: Likewise.
* brigfrontend/brig-inst-mod-handler.cc: Likewise.
* brigfrontend/brig-label-handler.cc: Likewise.
* brigfrontend/brig-lane-inst-handler.cc: Likewise.
* brigfrontend/brig-machine.c: Likewise.
* brigfrontend/brig-machine.h: Likewise.
* brigfrontend/brig-mem-inst-handler.cc: Likewise.
* brigfrontend/brig-module-handler.cc: Likewise.
* brigfrontend/brig-queue-inst-handler.cc: Likewise.
* brigfrontend/brig-seg-inst-handler.cc: Likewise.
* brigfrontend/brig-signal-inst-handler.cc: Likewise.
* brigfrontend/brig-to-generic.cc: Likewise.
* brigfrontend/brig-to-generic.h: Likewise.
* brigfrontend/brig-util.cc: Likewise.
* brigfrontend/brig-util.h: Likewise.
* brigfrontend/brig-variable-handler.cc: Likewise.
* brigfrontend/phsa.h: Likewise.
|