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