1 2018-05-18 Richard Sandiford <richard.sandiford@linaro.org>
3 * brigfrontend/brig-function.cc
4 (brig_function::get_builtin_for_hsa_opcode): Use BUILT_IN_FMA
6 (brig_function::get_tree_code_for_hsa_opcode): Treat BUILT_IN_FMA
9 2018-05-04 Pekka Jääskeläinen <pekka.jaaskelainen@parmance.com>
11 * brig/brigfrontend/brig-basic-inst-handler.cc: Fix handling of NOPs.
13 2018-05-04 Pekka Jääskeläinen <pekka.jaaskelainen@parmance.com>
15 Add flag -fassume-phsa that is on by default. If -fno-assume-phsa
16 is given, these optimizations are disabled. With this flag, gccbrig
17 can generate GENERIC that assumes we are targeting a phsa-runtime
18 based implementation, which allows us to expose the work-item context
19 accesses to retrieve WI IDs etc. which helps optimizers.
20 First optimization that takes advantage of this is to get rid of
21 the setworkitemid calls whenever we have non-inlined calls that
22 use IDs internally. Other optimizations added in this commit:
23 - expand absoluteid to similar level of simplicity as workitemid.
24 At the moment absoluteid is the best indexing ID to end up with
26 - propagate ID variables closer to their uses. This is mainly
27 to avoid known useless casts, which confuse at least scalar
29 - use signed long long for storing IDs. Unsigned integers have
30 defined wraparound semantics, which confuse at least scalar
31 evolution analysis, leading to unvectorizable WI loops.
32 - also refactor some BRIG function generation helpers to brig_function.
33 - no point in having the wi-loop as a for-loop. It's really
34 a do...while and SCEV can analyze it just fine still.
35 - add consts to ptrs etc. in BRIG builtin defs.
36 Improves optimization opportunities.
37 - add qualifiers to generated function parameters.
38 Const and restrict on the hidden local/private pointers,
39 the arg buffer and the context pointer help some optimizations.
40 * brig/brigfrontend/brig-basic-inst-handler.cc: See above.
41 * brig/brigfrontend/brig-branch-inst-handler.cc: See above.
42 * brig/brigfrontend/brig-cmp-inst-handler.cc: See above.
43 * brig/brigfrontend/brig-code-entry-handler.cc: See above.
44 * brig/brigfrontend/brig-code-entry-handler.h: See above.
45 * brig/brigfrontend/brig-control-handler.cc: See above.
46 * brig/brigfrontend/brig-cvt-inst-handler.cc: See above.
47 * brig/brigfrontend/brig-function-handler.cc: See above.
48 * brig/brigfrontend/brig-function.cc: See above.
49 * brig/brigfrontend/brig-function.h: See above.
50 * brig/brigfrontend/brig-label-handler.cc: See above.
51 * brig/brigfrontend/brig-lane-inst-handler.cc: See above.
52 * brig/brigfrontend/brig-mem-inst-handler.cc: See above.
53 * brig/brigfrontend/phsa.h: See above.
54 * brig/lang.opt: See above.
56 2018-05-04 Pekka Jääskeläinen <pekka.jaaskelainen@parmance.com>
58 * brig/brigfrontend/brig-function-handler.cc: Skip multiple forward
59 declarations of the same function.
61 2018-05-04 Pekka Jääskeläinen <pekka.jaaskelainen@parmance.com>
63 * brig/brig-lang.c: Do not allow optimizations based on known C
66 2018-05-04 Pekka Jääskeläinen <pekka.jaaskelainen@parmance.com>
68 * brig/brig-lang.c: Allow controlling strict aliasing from
71 2018-05-04 Pekka Jääskeläinen <pekka.jaaskelainen@parmance.com>
73 * brig/brigfrontend/brig-code-entry-handler.cc: The modulo in
74 ID computation should not be needed.
76 2018-05-04 Pekka Jääskeläinen <pekka.jaaskelainen@parmance.com>
78 * brig/brig-lang.c: Add support for whole program
79 optimizations by marking the kernels externally visible.
80 * brig/brigfrontend/brig-branch-inst-handler.cc: See above.
81 * brig/brigfrontend/brig-function-handler.cc: See above.
82 * brig/brigfrontend/brig-function.cc: See above.
83 * brig/brigfrontend/brig-to-generic.cc: See above.
84 * brig/brigfrontend/brig-to-generic.h: See above.
85 * brig/brigfrontend/brig-variable-handler.h: See above.
87 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
88 Alan Hayward <alan.hayward@arm.com>
89 David Sherwood <david.sherwood@arm.com>
91 * brigfrontend/brig-to-generic.cc (get_unsigned_int_type): Handle
92 polynomial TYPE_VECTOR_SUBPARTS.
93 * brigfrontend/brig-util.h (gccbrig_type_vector_subparts): Likewise.
95 2018-01-03 Jakub Jelinek <jakub@redhat.com>
97 Update copyright years.
99 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
100 Alan Hayward <alan.hayward@arm.com>
101 David Sherwood <david.sherwood@arm.com>
103 * brigfrontend/brig-util.h (gccbrig_type_vector_subparts): New
105 * brigfrontend/brig-basic-inst-handler.cc
106 (brig_basic_inst_handler::build_shuffle): Use it instead of
107 TYPE_VECTOR_SUBPARTS.
108 (brig_basic_inst_handler::build_unpack): Likewise.
109 (brig_basic_inst_handler::build_pack): Likewise.
110 (brig_basic_inst_handler::build_unpack_lo_or_hi): Likewise.
111 (brig_basic_inst_handler::operator ()): Likewise.
112 (brig_basic_inst_handler::build_lower_element_broadcast): Likewise.
113 * brigfrontend/brig-code-entry-handler.cc
114 (brig_code_entry_handler::get_tree_cst_for_hsa_operand): Likewise.
115 (brig_code_entry_handler::get_comparison_result_type): Likewise.
116 (brig_code_entry_handler::expand_or_call_builtin): Likewise.
118 2017-12-15 Jakub Jelinek <jakub@redhat.com>
120 * brig-lang.c (brig_attribute_table): Swap affects_type_identity
121 and handler fields, adjust comments.
123 2017-12-08 Jakub Jelinek <jakub@redhat.com>
125 * brig-lang.c (brig_attribute_table): Fix up comment.
127 2017-11-28 Jakub Jelinek <jakub@redhat.com>
129 * brigfrontend/brig-branch-inst-handler.cc
130 (brig_branch_inst_handler::operator): Build SWITCH_EXPR using build2
133 2017-11-17 Henry Linjamäki <henry.linjamaki@parmance.com>
135 * brigfrontend/brig-util.cc: Fix sprintf format string type mismatch
138 2017-11-16 Henry Linjamäki <henry.linjamaki@parmance.com>
140 Change internal representation of HSA registers. Instead
141 representing HSA's untyped registers as unsigned int the gccbrig
142 analyzes brig code and builds the register variables as a type
143 used in tree expressions at most. This gives better chance to
144 optimize CONVERT_VIEW_EXPRs away.
145 * brigfrontend/brig-code-entry-handler.cc: Add analysis method for
146 register type usage. Handle any-typed register variables.
147 * brigfrontend/brig-code-entry-handler.h: New declarations for the
149 * brigfrontend/brig-copy-move-inst-handler.cc: Handle any-typed
151 * brigfrontend/brig-cvt-inst-handler.cc: Likewise.
152 * brigfrontend/brig-function.cc: Build register variables as a
153 type based on results of analysis phase.
154 * brigfrontend/brig-function.h: Move HSA register count defines to
156 * brigfrontend/brig-to-generic.cc: New analysis handler. Analyze
158 * brigfrontend/brig-to-generic.h: New declarations.
159 * brigfrontend/brig-util.cc: New utility functions.
160 * brigfrontend/brig-util.h: New declarations for the above.
162 2017-11-16 Pekka Jääskeläinen <pekka.jaaskelainen@parmance.com>
164 * gccbrig.texi: Added some documentation.
166 2017-10-31 Henry Linjamäki <henry.linjamaki@parmance.com>
168 * brig-lang.c (brig_langhook_type_for_mode): Fix PR 82771.
170 2017-10-23 Richard Sandiford <richard.sandiford@linaro.org>
172 * brig-lang.c (brig_langhook_type_for_mode): Use scalar_int_mode
173 and scalar_float_mode.
175 2017-10-09 Pekka Jääskeläinen <pekka.jaaskelainen@parmance.com>
177 * brigfrontend/brig-to-generic.cc: Support BRIG_KIND_NONE
178 directives. These directives are legal everywhere. They
179 can be used to patch away BRIG entries at the binary level.
180 Also add extra error detection for zeroed regions: make sure
181 the byteCount field is never zero.
182 * brig/brigfrontend/phsa.h: Added a new error prefix for
183 errors which are due to corrupted BRIG modules.
185 2017-10-09 Henry Linjamäki <henry.linjamaki@parmance.com>
187 * brigfrontend/brig-branch-inst-handler.cc: The call code
188 still failed a few test cases. Now all PRM cases pass again.
190 2017-10-03 Henry Linjamäki <henry.linjamaki@parmance.com>
192 * brigfrontend/brig-branch-inst-handler.cc: Fix (more) crash with
193 calls with more than 4 args. It missed a reference which is required
194 because vector expansion can move the object to another location.
196 2017-09-29 Henry Linjamäki <henry.linjamaki@parmance.com>
198 * brigfrontend/brig-branch-inst-handler.cc: Fix crash with
199 calls with more than 4 args. Also fix a misexecution issue
200 with kernels that have both unexpanded ID functions and
201 calls to subfunctions.
203 2017-09-28 Henry Linjamäki <henry.linjamaki@parmance.com>
205 * brig-lang.c: Added function attributes and their handlers.
206 Make BRIGFE 3-level optimize by default.
208 2017-09-27 Pekka Jääskeläinen <pekka.jaaskelainen@parmance.com>
210 * brig-lang.c: Improved support for function and module scope
211 group segment variables. PRM specs defines function and module
212 scope group segment variables as an experimental feature. However,
213 PRM test suite uses and hcc relies on them. In addition, hcc
214 assumes certain group variable layout in its dynamic group segment
215 allocation code. We cannot have global group memory offsets if we
216 want to both have kernel-specific group segment size and multiple
217 kernels calling the same functions that use function scope group memory
218 variables. Now group segment is handled by separate book keeping of
219 module scope and function (kernel) offsets. Each function has a "frame"
220 in the group segment offset to which is given as an argument.
221 * brigfrontend/brig-branch-inst-handler.cc: See above.
222 * brigfrontend/brig-code-entry-handler.cc: See above.
223 * brigfrontend/brig-fbarrier-handler.cc: See above.
224 * brigfrontend/brig-function-handler.cc: See above.
225 * brigfrontend/brig-function.cc: See above.
226 * brigfrontend/brig-function.h: See above.
227 * brigfrontend/brig-to-generic.cc: See above.
228 * brigfrontend/brig-to-generic.h: See above.
229 * brigfrontend/brig-util.cc: See above.
230 * brigfrontend/brig-util.h: See above.
231 * brigfrontend/brig-variable-handler.cc: See above.
233 2017-09-25 Pekka Jääskeläinen <pekka.jaaskelainen@parmance.com>
235 * brigfrontend/brig-to-generic.cc: Ensure per WI copies of
236 private variables are aligned too.
238 2017-09-17 Thomas Schwinge <thomas@codesourcery.com>
240 * Make-lang.in (GO_TEXI_FILES): Rename to...
241 (BRIG_TEXI_FILES): ... this.
242 (doc/gccbrig.info, doc/gccbrig.dvi, doc/gccbrig.pdf, brig.info)
243 (brig.srcinfo, brig.man, brig.srcman, brig.install-man)
244 ($(DESTDIR)$(man1dir)/$(GCCBRIG_INSTALL_NAME)$(man1ext)):
245 Uncomment/enable targets.
246 (gccbrig.pod): New target.
247 * gccbrig.texi: New file.
249 2017-08-04 Henry Linjamäki <henry.linjamaki@parmance.com>
252 * brigfrontend/brig-basic-inst-handler.cc: replace build_int_cst with
253 bitsize_int in building BIT_FIELD_REF.
254 * brigfrontend/brig-code-entry-handler.cc: likewise.
256 2017-07-05 Richard Sandiford <richard.sandiford@linaro.org>
257 Alan Hayward <alan.hayward@arm.com>
258 David Sherwood <david.sherwood@arm.com>
260 * brig-c.h (brig_type_for_mode): Remove "enum" before "machine_mode".
261 * brig-lang.c (brig_langhook_type_for_mode): Likewise.
263 2017-07-04 Jakub Jelinek <jakub@redhat.com>
265 * brigfrontend/brig-function.cc: Include profile-count.h.
266 * brigfrontend/brig-to-generic.cc: Likewise.
268 2017-05-18 Thomas Schwinge <thomas@codesourcery.com>
270 * brigfrontend/brig-to-generic.h (class brig_to_generic): Use
271 "dump_flags_t" for "m_dump_flags" member.
273 2017-05-13 Pekka Jääskeläinen <pekka.jaaskelainen@parmance.com>
275 * brigfrontend/brig-code-entry-handler.cc
276 (brig_code_entry_handler::build_address_operand): Fix
277 an assertion when doing an 'lda' of a private array
280 2017-05-03 Pekka Jääskeläinen <pekka.jaaskelainen@parmance.com>
282 * brigfrontend/brig-code-entry-handler.cc
283 (brig_code_entry_handler::build_address_operand): Fix a bug
284 with reg+offset addressing on 32b segments. In large mode,
285 the offset is treated as 32bits unless it's global, readonly or
286 kernarg address space.
288 2016-02-01 Pekka Jääskeläinen <pekka.jaaskelainen@parmance.com>
290 * brigfrontend/brig-code-entry-handler.cc: fix address
291 expressions which refer only to offset 0, but nothing else.
292 * brigfrontend/brig-lane-inst-handler.cc: fix
293 activelanepermute_b64 HSAIL instruction.
294 * brigfrontend/brig-to-generic.cc: remove useless c_str()
295 call. Add missing va_end (). Fix PR79250.
297 2017-01-30 Jakub Jelinek <jakub@redhat.com>
299 * brigfrontend/brig-code-entry-handler.cc
300 (brig_code_entry_handler::get_tree_cst_for_hsa_operand): For %lu
301 cast size_t arguments to unsigned long.
303 2017-01-27 Pekka Jääskeläinen <pekka.jaaskelainen@parmance.com>
305 * config-lang.in: Removed stale target-libbrig reference.
307 2017-01-26 Jakub Jelinek <jakub@redhat.com>
309 Update copyright years.
311 2017-01-24 Pekka Jääskeläinen <pekka@parmance.com>
312 Martin Jambor <mjambor@suse.cz>
314 * Make-lang.in: New file.
315 * brig-builtins.h: Likewise.
316 * brig-c.h: Likewise.
317 * brig-lang.c: Likewise.
318 * brigspec.c: Likewise.
319 * config-lang.in: Likewise.
320 * lang-specs.h: Likewise.
321 * lang.opt: Likewise.
322 * brigfrontend/brig-arg-block-handler.cc: Likewise.
323 * brigfrontend/brig-atomic-inst-handler.cc: Likewise.
324 * brigfrontend/brig-basic-inst-handler.cc: Likewise.
325 * brigfrontend/brig-branch-inst-handler.cc: Likewise.
326 * brigfrontend/brig-cmp-inst-handler.cc: Likewise.
327 * brigfrontend/brig-code-entry-handler.cc: Likewise.
328 * brigfrontend/brig-code-entry-handler.h: Likewise.
329 * brigfrontend/brig-comment-handler.cc: Likewise.
330 * brigfrontend/brig-control-handler.cc: Likewise.
331 * brigfrontend/brig-copy-move-inst-handler.cc: Likewise.
332 * brigfrontend/brig-cvt-inst-handler.cc: Likewise.
333 * brigfrontend/brig-fbarrier-handler.cc: Likewise.
334 * brigfrontend/brig-function-handler.cc: Likewise.
335 * brigfrontend/brig-function.cc: Likewise.
336 * brigfrontend/brig-function.h: Likewise.
337 * brigfrontend/brig-inst-mod-handler.cc: Likewise.
338 * brigfrontend/brig-label-handler.cc: Likewise.
339 * brigfrontend/brig-lane-inst-handler.cc: Likewise.
340 * brigfrontend/brig-machine.c: Likewise.
341 * brigfrontend/brig-machine.h: Likewise.
342 * brigfrontend/brig-mem-inst-handler.cc: Likewise.
343 * brigfrontend/brig-module-handler.cc: Likewise.
344 * brigfrontend/brig-queue-inst-handler.cc: Likewise.
345 * brigfrontend/brig-seg-inst-handler.cc: Likewise.
346 * brigfrontend/brig-signal-inst-handler.cc: Likewise.
347 * brigfrontend/brig-to-generic.cc: Likewise.
348 * brigfrontend/brig-to-generic.h: Likewise.
349 * brigfrontend/brig-util.cc: Likewise.
350 * brigfrontend/brig-util.h: Likewise.
351 * brigfrontend/brig-variable-handler.cc: Likewise.
352 * brigfrontend/phsa.h: Likewise.