summaryrefslogtreecommitdiff
path: root/gcc/lra-constraints.c
diff options
context:
space:
mode:
authorVladimir Makarov <vmakarov@redhat.com>2018-02-22 21:17:51 +0000
committerVladimir Makarov <vmakarov@gcc.gnu.org>2018-02-22 21:17:51 +0000
commit7874b7c5b59923d8a56eaf41f7518c71b910355e (patch)
tree7268aa9b5a8752e1ace59914f5238e43daa7a182 /gcc/lra-constraints.c
parentb613cc2e9120ea002f8a0855d2620ee4ba8fbfe5 (diff)
downloadgcc-7874b7c5b59923d8a56eaf41f7518c71b910355e.tar.gz
re PR target/81572 (gcc-7 regression: unnecessary vector regmove on compare)
2018-02-22 Vladimir Makarov <vmakarov@redhat.com> PR target/81572 * lra-int.h (LRA_UNKNOWN_ALT, LRA_NON_CLOBBERED_ALT): New macros. * lra.c (lra_set_insn_recog_data, lra_update_insn_recog_data): Use LRA_UNKNOWN_ALT. * lra-constraints.c (curr_insn_transform): Set up LRA_NON_CLOBBERED_ALT for moves processed on the fast path. Use LRA_UNKNOWN_ALT. (remove_inheritance_pseudos): Use LRA_UNKNOWN_ALT. * lra-eliminations.c (spill_pseudos): Ditto. (process_insn_for_elimination): Ditto. * lra-lives.c (reg_early_clobber_p): Use the new macros. * lra-spills.c (spill_pseudos): Use LRA_UNKNOWN_ALT and LRA_NON_CLOBBERED_ALT. 2018-02-22 Vladimir Makarov <vmakarov@redhat.com> PR target/81572 * gcc.target/powerpc/pr81572.c: New. From-SVN: r257915
Diffstat (limited to 'gcc/lra-constraints.c')
-rw-r--r--gcc/lra-constraints.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c
index d730f36fba0..59b97540d98 100644
--- a/gcc/lra-constraints.c
+++ b/gcc/lra-constraints.c
@@ -3730,7 +3730,13 @@ curr_insn_transform (bool check_only_p)
curr_insn_set = single_set (curr_insn);
if (curr_insn_set != NULL_RTX && simple_move_p ())
- return false;
+ {
+ /* We assume that the corresponding insn alternative has no
+ earlier clobbers. If it is not the case, don't define move
+ cost equal to 2 for the corresponding register classes. */
+ lra_set_used_insn_alternative (curr_insn, LRA_NON_CLOBBERED_ALT);
+ return false;
+ }
no_input_reloads_p = no_output_reloads_p = false;
goal_alt_number = -1;
@@ -3838,7 +3844,7 @@ curr_insn_transform (bool check_only_p)
if (change_p)
/* If we've changed the instruction then any alternative that
we chose previously may no longer be valid. */
- lra_set_used_insn_alternative (curr_insn, -1);
+ lra_set_used_insn_alternative (curr_insn, LRA_UNKNOWN_ALT);
if (! check_only_p && curr_insn_set != NULL_RTX
&& check_and_process_move (&change_p, &sec_mem_p))
@@ -3846,7 +3852,7 @@ curr_insn_transform (bool check_only_p)
try_swapped:
- reused_alternative_num = check_only_p ? -1 : curr_id->used_insn_alternative;
+ reused_alternative_num = check_only_p ? LRA_UNKNOWN_ALT : curr_id->used_insn_alternative;
if (lra_dump_file != NULL && reused_alternative_num >= 0)
fprintf (lra_dump_file, "Reusing alternative %d for insn #%u\n",
reused_alternative_num, INSN_UID (curr_insn));
@@ -6752,7 +6758,7 @@ remove_inheritance_pseudos (bitmap remove_pseudos)
}
lra_push_insn_and_update_insn_regno_info (curr_insn);
lra_set_used_insn_alternative_by_uid
- (INSN_UID (curr_insn), -1);
+ (INSN_UID (curr_insn), LRA_UNKNOWN_ALT);
done_p = true;
if (lra_dump_file != NULL)
{
@@ -6791,7 +6797,7 @@ remove_inheritance_pseudos (bitmap remove_pseudos)
constraints pass. */
lra_push_insn_and_update_insn_regno_info (curr_insn);
lra_set_used_insn_alternative_by_uid
- (INSN_UID (curr_insn), -1);
+ (INSN_UID (curr_insn), LRA_UNKNOWN_ALT);
}
else if (restored_regs_p)
/* The instruction has been restored to the form that