aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2019-07-01 08:58:35 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2019-07-01 08:58:35 +0000
commitae5569fa33c9f3286e0b747f8b6607d21a4b9827 (patch)
treee304d56814b85dc09725acc219dd030b3af23839 /gcc
parented680e2cc18c73f90e6bfbd3f346a8820476371b (diff)
downloadgcc-ae5569fa33c9f3286e0b747f8b6607d21a4b9827.zip
gcc-ae5569fa33c9f3286e0b747f8b6607d21a4b9827.tar.gz
gcc-ae5569fa33c9f3286e0b747f8b6607d21a4b9827.tar.bz2
Allow earlyclobbers in ira_get_dup_out_num
ira_get_dup_out_num punted on operands that are matched to earlyclobber outputs: /* It is better ignore an alternative with early clobber. */ else if (*str == '&') goto fail; But I'm not sure why this is the right thing to do. At this stage we've established that *all* alternatives of interest require the input to match the output, so (a) the earlyclobber can only affect other operands and (b) not tying the registers is bound to introduce a move The code was part of the initial commit and so isn't obviously related to a specific testcase. Also, I can imagine LRA makes a much better job of this situation than reload did. (Certainly SVE uses matched earlyclobbers extensively and I haven't seen any problems.) In case this turns out to regress something important: the main case that matters for SVE is the one in which all alternatives are earlyclobber. 2019-07-01 Richard Sandiford <richard.sandiford@arm.com> gcc/ * ira.c (ira_get_dup_out_num): Don't punt for earlyclobbers. Use recog_data to test for an output operand. From-SVN: r272850
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/ira.c22
2 files changed, 7 insertions, 20 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8f70d1b..b49bc69 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2019-07-01 Richard Sandiford <richard.sandiford@arm.com>
+ * ira.c (ira_get_dup_out_num): Don't punt for earlyclobbers.
+ Use recog_data to test for an output operand.
+
+2019-07-01 Richard Sandiford <richard.sandiford@arm.com>
+
* ira.c (ira_setup_alts): If any valid alternatives have zero cost,
exclude any others that are disparaged or that are bound to need
a reload or spill.
diff --git a/gcc/ira.c b/gcc/ira.c
index d9327db..214fdff 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -1999,26 +1999,8 @@ ira_get_dup_out_num (int op_num, alternative_mask alts)
}
if (original == -1)
goto fail;
- dup = -1;
- for (ignore_p = false, str = recog_data.constraints[original - '0'];
- *str != 0;
- str++)
- if (ignore_p)
- {
- if (*str == ',')
- ignore_p = false;
- }
- else if (*str == '#')
- ignore_p = true;
- else if (! ignore_p)
- {
- if (*str == '=')
- dup = original - '0';
- /* It is better ignore an alternative with early clobber. */
- else if (*str == '&')
- goto fail;
- }
- if (dup >= 0)
+ dup = original - '0';
+ if (recog_data.operand_type[dup] == OP_OUT)
return dup;
fail:
if (use_commut_op_p)