comparison gcc/lra-remat.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
1 /* Rematerialize pseudos values. 1 /* Rematerialize pseudos values.
2 Copyright (C) 2014-2017 Free Software Foundation, Inc. 2 Copyright (C) 2014-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
706 706
707 for (iter = 0; iter < 2; iter++) 707 for (iter = 0; iter < 2; iter++)
708 for (reg = (iter == 0 ? id->regs : static_id->hard_regs); 708 for (reg = (iter == 0 ? id->regs : static_id->hard_regs);
709 reg != NULL; 709 reg != NULL;
710 reg = reg->next) 710 reg = reg->next)
711 if (reg->type == OP_IN && reg->regno <= FIRST_PSEUDO_REGISTER 711 if (reg->type == OP_IN && reg->regno < FIRST_PSEUDO_REGISTER
712 && TEST_HARD_REG_BIT (call_used_reg_set, reg->regno)) 712 && TEST_HARD_REG_BIT (call_used_reg_set, reg->regno))
713 return true; 713 return true;
714 return false; 714 return false;
715 } 715 }
716 716
992 992
993 993
994 994
995 /* Setup sp offset attribute to SP_OFFSET for all INSNS. */ 995 /* Setup sp offset attribute to SP_OFFSET for all INSNS. */
996 static void 996 static void
997 change_sp_offset (rtx_insn *insns, HOST_WIDE_INT sp_offset) 997 change_sp_offset (rtx_insn *insns, poly_int64 sp_offset)
998 { 998 {
999 for (rtx_insn *insn = insns; insn != NULL; insn = NEXT_INSN (insn)) 999 for (rtx_insn *insn = insns; insn != NULL; insn = NEXT_INSN (insn))
1000 eliminate_regs_in_insn (insn, false, false, sp_offset); 1000 eliminate_regs_in_insn (insn, false, false, sp_offset);
1001 } 1001 }
1002 1002
1116 break; 1116 break;
1117 } 1117 }
1118 int i, hard_regno, nregs; 1118 int i, hard_regno, nregs;
1119 int dst_hard_regno, dst_nregs; 1119 int dst_hard_regno, dst_nregs;
1120 rtx_insn *remat_insn = NULL; 1120 rtx_insn *remat_insn = NULL;
1121 HOST_WIDE_INT cand_sp_offset = 0; 1121 poly_int64 cand_sp_offset = 0;
1122 if (cand != NULL) 1122 if (cand != NULL)
1123 { 1123 {
1124 lra_insn_recog_data_t cand_id 1124 lra_insn_recog_data_t cand_id
1125 = lra_get_insn_recog_data (cand->insn); 1125 = lra_get_insn_recog_data (cand->insn);
1126 struct lra_static_insn_data *static_cand_id 1126 struct lra_static_insn_data *static_cand_id
1239 bitmap_clear_bit (active_cands, cand->index); 1239 bitmap_clear_bit (active_cands, cand->index);
1240 } 1240 }
1241 1241
1242 if (remat_insn != NULL) 1242 if (remat_insn != NULL)
1243 { 1243 {
1244 HOST_WIDE_INT sp_offset_change = cand_sp_offset - id->sp_offset; 1244 poly_int64 sp_offset_change = cand_sp_offset - id->sp_offset;
1245 if (sp_offset_change != 0) 1245 if (maybe_ne (sp_offset_change, 0))
1246 change_sp_offset (remat_insn, sp_offset_change); 1246 change_sp_offset (remat_insn, sp_offset_change);
1247 update_scratch_ops (remat_insn); 1247 update_scratch_ops (remat_insn);
1248 lra_process_new_insns (insn, remat_insn, NULL, 1248 lra_process_new_insns (insn, remat_insn, NULL,
1249 "Inserting rematerialization insn"); 1249 "Inserting rematerialization insn");
1250 lra_set_insn_deleted (insn); 1250 lra_set_insn_deleted (insn);