comparison gcc/lra-int.h @ 132:d34655255c78

update gcc-8.2
author mir3636
date Thu, 25 Oct 2018 10:21:07 +0900
parents 84e7813d76e9
children 1830386684a0
comparison
equal deleted inserted replaced
130:e108057fa461 132:d34655255c78
1 /* Local Register Allocator (LRA) intercommunication header file. 1 /* Local Register Allocator (LRA) intercommunication header file.
2 Copyright (C) 2010-2017 Free Software Foundation, Inc. 2 Copyright (C) 2010-2018 Free Software Foundation, Inc.
3 Contributed by Vladimir Makarov <vmakarov@redhat.com>. 3 Contributed by Vladimir Makarov <vmakarov@redhat.com>.
4 4
5 This file is part of GCC. 5 This file is part of GCC.
6 6
7 GCC is free software; you can redistribute it and/or modify it under 7 GCC is free software; you can redistribute it and/or modify it under
104 rtx restore_rtx; 104 rtx restore_rtx;
105 /* Value holding by register. If the pseudos have the same value 105 /* Value holding by register. If the pseudos have the same value
106 they do not conflict. */ 106 they do not conflict. */
107 int val; 107 int val;
108 /* Offset from relative eliminate register to pesudo reg. */ 108 /* Offset from relative eliminate register to pesudo reg. */
109 int offset; 109 poly_int64 offset;
110 /* These members are set up in lra-lives.c and updated in 110 /* These members are set up in lra-lives.c and updated in
111 lra-coalesce.c. */ 111 lra-coalesce.c. */
112 /* The biggest size mode in which each pseudo reg is referred in 112 /* The biggest size mode in which each pseudo reg is referred in
113 whole function (possibly via subreg). */ 113 whole function (possibly via subreg). */
114 machine_mode biggest_mode; 114 machine_mode biggest_mode;
119 lra_copy_t copies; 119 lra_copy_t copies;
120 }; 120 };
121 121
122 /* References to the common info about each register. */ 122 /* References to the common info about each register. */
123 extern struct lra_reg *lra_reg_info; 123 extern struct lra_reg *lra_reg_info;
124
125 extern HARD_REG_SET hard_regs_spilled_into;
124 126
125 /* Static info about each insn operand (common for all insns with the 127 /* Static info about each insn operand (common for all insns with the
126 same ICODE). Warning: if the structure definition is changed, the 128 same ICODE). Warning: if the structure definition is changed, the
127 initializer for debug_operand_data in lra.c should be changed 129 initializer for debug_operand_data in lra.c should be changed
128 too. */ 130 too. */
164 just a part of the register. */ 166 just a part of the register. */
165 unsigned int subreg_p : 1; 167 unsigned int subreg_p : 1;
166 /* True if there is an early clobber alternative for this 168 /* True if there is an early clobber alternative for this
167 operand. */ 169 operand. */
168 unsigned int early_clobber : 1; 170 unsigned int early_clobber : 1;
171 /* True if the reg is clobber highed by the operand. */
172 unsigned int clobber_high : 1;
169 /* The corresponding regno of the register. */ 173 /* The corresponding regno of the register. */
170 int regno; 174 int regno;
171 /* Next reg info of the same insn. */ 175 /* Next reg info of the same insn. */
172 struct lra_insn_reg *next; 176 struct lra_insn_reg *next;
173 }; 177 };
200 given operand in given alternative. This info can be changed if 204 given operand in given alternative. This info can be changed if
201 the target reg info is changed. */ 205 the target reg info is changed. */
202 const struct operand_alternative *operand_alternative; 206 const struct operand_alternative *operand_alternative;
203 }; 207 };
204 208
209 /* Negative insn alternative numbers used for special cases. */
210 #define LRA_UNKNOWN_ALT -1
211 #define LRA_NON_CLOBBERED_ALT -2
212
205 /* LRA internal info about an insn (LRA internal insn 213 /* LRA internal info about an insn (LRA internal insn
206 representation). */ 214 representation). */
207 struct lra_insn_recog_data 215 struct lra_insn_recog_data
208 { 216 {
209 /* The insn code. */ 217 /* The insn code. */
210 int icode; 218 int icode;
211 /* The alternative should be used for the insn, -1 if invalid, or we 219 /* The alternative should be used for the insn, LRA_UNKNOWN_ALT if
212 should try to use any alternative, or the insn is a debug 220 unknown, or we should assume any alternative, or the insn is a
213 insn. */ 221 debug insn. LRA_NON_CLOBBERED_ALT means ignoring any earlier
222 clobbers for the insn. */
214 int used_insn_alternative; 223 int used_insn_alternative;
215 /* SP offset before the insn relative to one at the func start. */ 224 /* SP offset before the insn relative to one at the func start. */
216 HOST_WIDE_INT sp_offset; 225 poly_int64 sp_offset;
217 /* The insn itself. */ 226 /* The insn itself. */
218 rtx_insn *insn; 227 rtx_insn *insn;
219 /* Common data for insns with the same ICODE. Asm insns (their 228 /* Common data for insns with the same ICODE. Asm insns (their
220 ICODE is negative) do not share such structures. */ 229 ICODE is negative) do not share such structures. */
221 struct lra_static_insn_data *insn_static_data; 230 struct lra_static_insn_data *insn_static_data;
307 extern void lra_update_dups (lra_insn_recog_data_t, signed char *); 316 extern void lra_update_dups (lra_insn_recog_data_t, signed char *);
308 317
309 extern void lra_process_new_insns (rtx_insn *, rtx_insn *, rtx_insn *, 318 extern void lra_process_new_insns (rtx_insn *, rtx_insn *, rtx_insn *,
310 const char *); 319 const char *);
311 320
312 extern bool lra_substitute_pseudo (rtx *, int, rtx, bool); 321 extern bool lra_substitute_pseudo (rtx *, int, rtx, bool, bool);
313 extern bool lra_substitute_pseudo_within_insn (rtx_insn *, int, rtx, bool); 322 extern bool lra_substitute_pseudo_within_insn (rtx_insn *, int, rtx, bool);
314 323
315 extern lra_insn_recog_data_t lra_set_insn_recog_data (rtx_insn *); 324 extern lra_insn_recog_data_t lra_set_insn_recog_data (rtx_insn *);
316 extern lra_insn_recog_data_t lra_update_insn_recog_data (rtx_insn *); 325 extern lra_insn_recog_data_t lra_update_insn_recog_data (rtx_insn *);
317 extern void lra_set_used_insn_alternative (rtx_insn *, int); 326 extern void lra_set_used_insn_alternative (rtx_insn *, int);
347 extern int lra_undo_inheritance_iter; 356 extern int lra_undo_inheritance_iter;
348 extern bool lra_constrain_insn (rtx_insn *); 357 extern bool lra_constrain_insn (rtx_insn *);
349 extern bool lra_constraints (bool); 358 extern bool lra_constraints (bool);
350 extern void lra_constraints_init (void); 359 extern void lra_constraints_init (void);
351 extern void lra_constraints_finish (void); 360 extern void lra_constraints_finish (void);
361 extern bool spill_hard_reg_in_range (int, enum reg_class, rtx_insn *, rtx_insn *);
352 extern void lra_inheritance (void); 362 extern void lra_inheritance (void);
353 extern bool lra_undo_inheritance (void); 363 extern bool lra_undo_inheritance (void);
354 364
355 /* lra-lives.c: */ 365 /* lra-lives.c: */
356 366
380 /* lra-assigns.c: */ 390 /* lra-assigns.c: */
381 391
382 extern int lra_assignment_iter; 392 extern int lra_assignment_iter;
383 extern int lra_assignment_iter_after_spill; 393 extern int lra_assignment_iter_after_spill;
384 extern void lra_setup_reg_renumber (int, int, bool); 394 extern void lra_setup_reg_renumber (int, int, bool);
385 extern bool lra_assign (void); 395 extern bool lra_assign (bool &);
386 396 extern bool lra_split_hard_reg_for (void);
387 397
388 /* lra-coalesce.c: */ 398 /* lra-coalesce.c: */
389 399
390 extern int lra_coalesce_iter; 400 extern int lra_coalesce_iter;
391 extern bool lra_coalesce (void); 401 extern bool lra_coalesce (void);
404 /* lra-elimination.c: */ 414 /* lra-elimination.c: */
405 415
406 extern void lra_debug_elim_table (void); 416 extern void lra_debug_elim_table (void);
407 extern int lra_get_elimination_hard_regno (int); 417 extern int lra_get_elimination_hard_regno (int);
408 extern rtx lra_eliminate_regs_1 (rtx_insn *, rtx, machine_mode, 418 extern rtx lra_eliminate_regs_1 (rtx_insn *, rtx, machine_mode,
409 bool, bool, HOST_WIDE_INT, bool); 419 bool, bool, poly_int64, bool);
410 extern void eliminate_regs_in_insn (rtx_insn *insn, bool, bool, HOST_WIDE_INT); 420 extern void eliminate_regs_in_insn (rtx_insn *insn, bool, bool, poly_int64);
411 extern void lra_eliminate (bool, bool); 421 extern void lra_eliminate (bool, bool);
412 422
413 extern void lra_eliminate_reg_if_possible (rtx *); 423 extern void lra_eliminate_reg_if_possible (rtx *);
414 424
415 425
491 return lra_set_insn_recog_data (insn); 501 return lra_set_insn_recog_data (insn);
492 } 502 }
493 503
494 /* Update offset from pseudos with VAL by INCR. */ 504 /* Update offset from pseudos with VAL by INCR. */
495 static inline void 505 static inline void
496 lra_update_reg_val_offset (int val, int incr) 506 lra_update_reg_val_offset (int val, poly_int64 incr)
497 { 507 {
498 int i; 508 int i;
499 509
500 for (i = FIRST_PSEUDO_REGISTER; i < max_reg_num (); i++) 510 for (i = FIRST_PSEUDO_REGISTER; i < max_reg_num (); i++)
501 { 511 {
504 } 514 }
505 } 515 }
506 516
507 /* Return true if register content is equal to VAL with OFFSET. */ 517 /* Return true if register content is equal to VAL with OFFSET. */
508 static inline bool 518 static inline bool
509 lra_reg_val_equal_p (int regno, int val, int offset) 519 lra_reg_val_equal_p (int regno, int val, poly_int64 offset)
510 { 520 {
511 if (lra_reg_info[regno].val == val 521 if (lra_reg_info[regno].val == val
512 && lra_reg_info[regno].offset == offset) 522 && known_eq (lra_reg_info[regno].offset, offset))
513 return true; 523 return true;
514 524
515 return false; 525 return false;
516 } 526 }
517 527