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
|
2004-04-20 Geoffrey Keating <geoffk@apple.com>
* c-cppbuiltin.c (define__GNUC__): Better precision and more
error checking for code defining __APPLE_CC__.
* testsuite/gcc.apple/applecc.c: New.
2004-04-15 Devang Patel <dpatel@apple.com>
* config/i386.h: Add static tree nodes for vector types to
accomodate tree.h changes due to local Altivec patch.
2004-04-15 Caroline Tice <ctice@apple.com>
Fix various problems related to hot/cold partitioning (but not all of
them yet).
* bb-reorder.c (tm_p.h): Add new include statement.
(HAVE_return): Define HAVE_return appropriately if not already defined.
(find_rarely_executed_basic_blocks_and_crossing_edges): Modify to
only mark crossing edges if architecture supports named sections.
(fix_crossing_conditional_branches): Add test for HAVE_return before
calling gen_return.
(fix_crossing_unconditional_branches): Change VOIDmode to Pmode in call
to gen_rtl_LABEL_REF.
(fix_edges_for_rarely_executed_code): Only "fix" branches and add
REG_CROSSING_JUMP notes if the architecture supports named sections.
(reorder_basic_blocks): Change (* targetm.cannot_modify_jumps_p ())
into (targetm.cannot_modify_jumps_p ()). Modify to only add
NOTE_INSN_UNLIKELY_EXECUTED_CODE notes if the architecture supports
named sections.
* cfglayout.c (fixup_reorder_chain): Modify code that adds
NOTE_INSN_UNLIKELY_EXECUTED_CODE and REG_CROSSING_JUMP notes, to only
do so if architecture supports named sections.
* cfgrtl.c (target.h): Add new include statement.
(force_nonfallthru_and_redirect): Modify code that adds
NOTE_INSN_UNLIKELY_EXECUTED_CODE and REG_CROSSING_JUMP notes, to only
do so if architecture supports named sections.
(commit_one_edge_insertion): Likewise.
* dbxout.c (dbxout_source_file): Fix bug, when writing out source
location debug information, to not change to the wrong section.
* defaults.h (NORMAL_TEXT_SECTION_NAME): Remove this definition.
(SECTION_FORMAT_STRING): Remove this definition.
* final.c (final_scan_insn): Remove unnecessary in_unlikely_text_section
test from if statement. Modify code that switches sections to not
do so if architecture does not support named sections. Cleaned up
if statement.
* ifcvt.c (if_convert): Modified test that disables optimization when
partitioning, to not disable it if the architecture does not support
named sections.
* passes.c (rest_of_compilation): Removed flag_exceptions test from
code that calls partitioning, as this is already taken care of
in decode_options.
* predict.c (choose_function_section): Modify to NOT choose hot or
cold sections for the function decl if we are doing partitioning
optimization (want to leave it up to the hot/cold partitioning
optimization, which is more fine-grained).
* varasm.c (text_section): Restore code that outputs assembly for
the text section to its original code.
(unlikely_text_section): Modify to always use named_section for
writing out section directive, remove unnecessary ifdef, and
use ASM_OUTPUT_LABEL for labelling the start of the
cold section.
(in_unlikely_text_section): Modify to deal correctly with being in
a named section.
(function_section): Restore code for generating section directives
to its original order.
* config/darwin.c (darwin_asm_named_section): Restore code that
generates section directive to its original state.
* config/i386/darwin.h (ASM_OUTPUT_ALIGN): Add in_unlikely_text_section ()
to an if test that tests for in_text_section ().
* config/rs6000/darwin.h (NORMAL_TEXT_SECTION_NAME): Remove definition.
(SECTION_FORMAT_STRING): Remove definition.
2004-04-10 Paolo Bonzini <bonzini@gnu.org>
Richard Henderson <rth@redhat.com>
PR target/14899
* c-common.c (vector_types_compatible_p): New function.
* c-typeck.c (comptypes): Recurse on vector types,
treat a non-opaque type as equivalent to an opaque type.
(convert_for_assignment): Use vector_types_compatible_p.
(digest_init): Use vector_types_compatible_p to check
validness of constant vector initializers; otherwise treat
them as scalars
* tree.c (make_or_reuse_type): New.
(build_common_tree_nodes): Use it.
* cp/call.c (standard_conversion): Likewise.
* cp/typeck.c (comptypes): Recurse on vector types, do not
treat a non-opaque type as equivalent to an opaque type.
(convert_for_assignment): Use vector_types_compatible_p.
2004-04-13 Fariborz Jahanian <fjahanian@apple.com>
* combine.c (combine_instructions):
Try insn with each REG_EQUAL note it links back to.
(unmentioned_reg_p_1, unmentioned_reg_p): New functions.
Brought from tree-ssa branch.
2004-04-09 Dale Johannesen <dalej@apple.com>
Roll in gcc-1552 enhancement for separate stack temps.
Turn on -fstrict-aliasing with -fast.
* function.c (assign_stack_local_with_alias): New function.
* rtl.h (assign_stack_local_with_alias): Declare it.
* config/rs6000/rs6000.c (rs6000_override_options): Turn on strict
aliasing with -fast.
* config/rs6000/rs6000.md (floatsidf2): Use
assign_stack_local_with_alias.
(floatunssidf2): Ditto.
(fix_truncdfsi2): Ditto.
2004-04-07 Fariborz Jahanian <fjahanian@apple.com>
Roll in Ziem Laski's Altivec front-end fixes to
support MOTOROLA's Altivec syntax.
* Makefile.in: Add c-lex.o dependencies.
* c-common.c (vector_constructor_from_expr): New function.
* c-common.h (vector_constructor_from_expr): Add declaration.
* c-lex.c: include target.h, cpphash.h. Add lexer support
for new syntax.
(c_lex_prepend): new function. (c_lex_peek): new function.
* c-pragma.h: add (c_lex_peek, c_lex_prepend) declarations.
2004-04-06 Dale Johannesen <dalej@apple.com>
Roll in Zdenek Dvorak's rewrite of doloop optimization.
* Makefile.in: add loop-doloop.*, remove doloop.*
* loop-doloop.c: New.
* doloop.c: Remove.
* cfgloop.h: Add new function declarations.
* cfgloopanal.c: Add get_loop_level.
* loop-iv.c: Recognize unexecuted loops.
* loop.c: Remove call to old doloop optimization.
* loop.h: Remove LOOP_BCT.
* passes.c: Ditto. Call new doloop optimization.
* config/rs6000/rs6000-protos.h: Remove duplicate declarations.
* config/rs6000/rs6000.c: Cosmetic cleanups. Add -freorder-blocks
to -fast.
2004-04-02 Ziemowit Laski <zlaski@apple.com>
Remove APPLE LOCAL AltiVec code whenever possible; merge in
AltiVec/VECTOR_TYPE-handling code from mainline.
2004-04-01 Fariborz Jahanian <fjahanian@apple.com>
* Makefile.in: add $(PARAMS_H) $(TM_P_H) dependencies
for sched-rgn.o.
* params.def: add definitions for
max-sched-region-blocks and max-sched-region-insns.
* sched-rgn.c (too_large): change return type to bool.
Use the parametrized values of max-sched-region-blocks,
max-sched-region-insns for computing upper limits for
interblock scheduling.
* doc/invoke.texi: Document max-sched-region-blocks,
max-sched-region-insns.
2004-04-01 Caroline Tice <ctice@apple.com>
* basic-block.h (struct edge_def): Add new field, crossing_edge.
(struct basic_block_def): Add new field, partition.
(UNPARTITIONED, HOT_PARTITION, COLD_PARTITION): New constant macro
definitions.
(partition_hot_cold_basic_blocks): Add extern function
declaration.
* bb-reorder.c (function.h, obstack.h, expr.h, regs.h): Add four new
include statements.
(N_ROUNDS): Increase the maximum number of rounds by 1.
(branch_threshold): Add array value for new round.
(exec_threshold): Add array value for new round.
(push_to_next_round_p): New function.
(add_unlikely_executed_notes): New function.
(find_rarely_executed_basic_blocks_and_crossing_edges): New function.
(mark_bb_for_unlikely_executed_section): New function.
(add_labels_and_missing_jumps): New function.
(add_reg_crossing_jump_notes): New function.
(fix_up_fall_thru_edges): New function.
(find_jump_block): New function.
(fix_crossing_conditional_branches): New function.
(fix_crossing_unconditional_branches): New function.
(fix_edges_for_rarely_executed_code): New function.
(partition_hot_cold_basic_blocks): New function.
(find_traces): Add an extra round for partitioning hot/cold
basic blocks.
(find_traces_1_round): Add a parameter. Modify to push all cold blocks,
and only cold blocks, into the last (extra) round of collecting traces.
(better_edge_p): Add a parameter. Modify to favor non-crossing edges
over crossing edges.
(bb_to_key): Add code to correctly identify cold blocks when
doing partitioning.
(connect_traces): Modify to connect all the non-cold traces first, then
go back and connect up all the cold traces.
(reorder_basic_blocks): Add call to add_unlikely_executed_notes.
* cfg.c (entry_exit_blocks): Add initialization for partition field in
entry and exit blocks.
* cfgbuild.c (make_edges): Update current_function_has_computed_jump
if we are doing hot/cold partitioning.
* cfgcleanup.c (cfglayout.h): Add new include statement.
(try_simplify_condjump): Modify to not attempt on blocks with jumps
that cross section boundaries.
(try_forward_edges): Likewise.
(merge_blocks_move_predecessor_nojumps): Likewise.
(merge_blocks_move_successor_nojumps): Likewise.
(merge_blocks_move): Likewise.
(try_crossjump_to_edge): Modify to not attempt after we have done
the block partitioning.
(try_crossjump_bb): Modify to not attempt on blocks with jumps that
cross section boundaries.
(try_optimize_cfg): Likewise.
* cfghooks.c (tidy_fallthru_edges): Modify to not remove indirect
jumps that cross section boundaries.
* cfglayout.c (flags.h): Add new include statement.
(update_unlikely_executed_notes): New function.
(fixup_reorder_chain): Add code so when a new jumping basic block is
added, it's UNLIKELY_EXECUTED_CODE and REG_CROSSING_JUMP notes are
updated appropriately.
(duplicate_insn_chain): Add code to duplicate the new NOTE insn
introduced by this optimization.
* cfglayout.h (scan_ahead_for_unlikely_executed_note): Add new
extern function declaration.
* cfgrtl.c (can_delete_note_p): Add NOTE_INSN_UNLIKELY_EXECUTED_CODE to
list of notes that can be deleted.
(create_basic_block_structure): Add initialization for partition field.
(rtl_can_merge_blocks): Modify to test blocks for jumps that cross
section boundaries.
(try_redirect_by_replacing_jump): Modify to not attempt on jumps that
cross section boundaries.
(commit_one_edge_insertion): Add code so newly created basic block
ends up in correct (hot or cold) section. Modify to disallow
insertions before NOTE_INSN_UNLIKELY_EXECUTED_CODE notes.
(rtl_verify_flow_info_1): Add code to verify that no fall_thru edge
crosses section boundaries.
(cfg_layout_can_merge_blocks_p): Modify to test blocks for jumps that
cross section boundaries.
(force_nonfallthru_and_redirect): Modify to make sure new basic block
ends up in correct section, with correct notes attached.
* common.opt (freorder-blocks-and-partition): Add new flag for this
optimization.
* dbxout.c (dbx_function_end): Add code to make sure scope labels at
the end of functions are written into the correct (hot or cold)
section.
(dbx_source_file): Add code so writing debug file information
doesn't incorrectly change sections.
* defaults.h (NORMAL_TEXT_SECTION_NAME): New constant macro, for use
in partitioning hot/cold basic blocks into separate sections.
(SECTION_FORMAT_STRING): New constant macro, for linux/i386 hot/cold
section partitioning.
(HAS_LONG_COND_BRANCH): New constant macro, indicating whether or not
conditional branches can span all of memory.
(HAS_LONG_UNCOND_BRANCH): New constant macro, indicationg whether or not
unconditional branches can span all of memory.
* final.c (scan_ahead_for_unlikely_executed_note): New function.
(final_scan_insn): Add code to check for NOTE instruction indicating
whether basic block belongs in hot or cold section, and to make sure
the current basic block is being written to the appropriate section.
Also added code to ensure that jump table basic blocks end up in the
correct section.
* flags.h (flag_reorder_blocks_and_partition): New flag.
* ifcvt.c (find_if_case_1): Modify to not attempt if conversion if
one of the branches has a jump that crosses between sections.
(find_if_case_2): Likewise.
(ifcvt): Modify to not attempt to mark loop exit edges after
hot/cold partitioning has occurred.
* opts.c (decode_options): Code to handle new flag,
flag_reorder_blocks_and_partition; also to turn it off if
flag_exceptions is on.
(common_handle_option): Code to handle new flag,
flag_reorder_blocks_and_partition.
* output.h (unlikely_text_section): New extern function declaration.
(in_unlikely_text_section): New extern function declaration.
* passes.c (rest_of_handle_stack_regs): Add
flag_reorder_blocks_and_partition as an 'or' condition for calling
reorder_basic_blocks.
(rest_of_handle_reorder_blocks): Add flag_reorder_blocks_and_partition
as an 'or' condition for calling reorder_basic_blocks.
(rest_of_compilation): Add call to partition_hot_cold_basic_blocks.
* print-rtl.c (print_rtx): Add code for handling new note,
NOTE_INSN_UNLIKELY_EXECUTED_CODE
* rtl.c (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note insn (see below).
(REG_CROSSING_JUMP): New kind of reg_note, to mark jumps that
cross between section boundaries.
* rtl.h (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note instruction,
indicating the basic block containing it belongs in the cold section.
(REG_CROSSING_JUMP): New type of reg_note, to mark jumps that cross
between hot and cold sections.
* toplev.c (flag_reorder_blocks_and_partition): Add code to
initialize this flag, and to tie it to the command-line option
freorder-blocks-and-partition.
* varasm.c (cfglayout.h): Add new include statement.
(unlikely_section_label_printed): New global variable, used for
determining when to output section name labels for cold sections.
(in_section): Add in_unlikely_executed_text to enum data structure.
(text_section): Modify code to use SECTION_FORMAT_STRING and
NORMAL_TEXT_SECTION_NAME macros.
(unlikely_text_section): New function.
(in_unlikely_text_section): New function.
(function_section): Add code to make sure beginning of function is
written into correct section (hot or cold).
(assemble_start_function): Add code to make sure stuff is written to
the correct section.
(assemble_zeros): Add in_unlikely_text_section as an 'or' condition
to an if statement that was checking 'in_text_section'.
(assemble_variable): Add 'in_unlikely_text_section' as an 'or'
condition to an if statement that was checking 'in_text_section'.
(default_section_type_flags_1): Add check: if in cold section
flags = SECTION_CODE.
* config/darwin.c (darwin_asm_named_section): Modify to use
SECTION_FORMAT_STRING if we are partitioning hot/cold blocks.
* config/i386/i386.h (HAS_LONG_COND_BRANCH): Defined this macro
specifically for the i386.
(HAS_LONG_UNCOND_BRANCH): Defined this macro specifically for the i386.
* config/rs6000/darwin.h (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Change
text string to something more informative.
(NORMAL_TEXT_SECTION_NAME): Add new definition.
(SECTION_FORMAT_STRING): Add new definition.
* config/rs6000/rs6000.c (rs6000_assemble_integer): Add
'!in_unlikely_text_section' as an 'and' condition to an if statement
that was already checking '!in_text_section'.
(rs6000_override_options): Turn on flag_reorder_blocks_and_partition
with "-fast".
* config/rs6000/sysv4.h (HOT_TEXT_SECTION_NAME,NORMAL_TEXT_SECTION_NAME,
UNLIKELY_EXECUTED_TEXT_SECTION_NAME,SECTION_FORMAT_STRING): Make
sure these are properly defined for linux on ppc.
* doc/invoke.texi (freorder-blocks-and-partition): Add documentation
for this new flag.
* doc/rtl.texi (REG_CROSSING_JUMP): Add documentation for new
reg_note.
* doc/tm.texi (NORMAL_TEXT_SECTION_NAME, SECTION_FORMAT_STRING,
HAS_LONG_COND_BRANCH, HAS_LONG_UNCOND_BRANCH): Add documentation for
these new macros.
|