diff options
author | Segher Boessenkool <segher@kernel.crashing.org> | 2017-11-29 23:42:37 +0100 |
---|---|---|
committer | Segher Boessenkool <segher@gcc.gnu.org> | 2017-11-29 23:42:37 +0100 |
commit | 4a01617886c1833f456948048e5167dac784ef19 (patch) | |
tree | 84cbcb2424e0e5745b60c58f0ffc57a5dfe877f9 /gcc | |
parent | 18b776e936e15310907e014e4e460d45d148bbf6 (diff) | |
download | gcc-4a01617886c1833f456948048e5167dac784ef19.zip gcc-4a01617886c1833f456948048e5167dac784ef19.tar.gz gcc-4a01617886c1833f456948048e5167dac784ef19.tar.bz2 |
combine: Do not throw away unneeded arms of parallels (PR83156)
The fix for PR82621 makes us not split an I2 if one of the results of
those SETs is unused, since combine does not handle that properly. But
this results in degradation for i386 (or more in general, for any
target that does not have patterns for parallels with an unused result
as a CLOBBER instead of a SET for that result).
This patch instead makes us not split only if one of the results is set
again before I3. That fixes PR83156 and also fixes PR82621.
Unfortunately it undoes the nice optimisations that the previous patch
did on powerpc.
PR rtl-optimization/83156
PR rtl-optimization/82621
* combine.c (try_combine): Don't split an I2 if one of the dests is
set again before I3. Allow unused dests.
From-SVN: r255260
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/combine.c | 3 |
2 files changed, 9 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 62ca3dc..c13f67e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,12 @@ 2017-11-29 Segher Boessenkool <segher@kernel.crashing.org> + PR rtl-optimization/83156 + PR rtl-optimization/82621 + * combine.c (try_combine): Don't split an I2 if one of the dests is + set again before I3. Allow unused dests. + +2017-11-29 Segher Boessenkool <segher@kernel.crashing.org> + * config/rs6000/rs6000.md (*add<mode>3_carry_in_internal2): New. 2017-11-29 Vladimir Makarov <vmakarov@redhat.com> diff --git a/gcc/combine.c b/gcc/combine.c index 0ce0751..cfe24f4 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -3016,7 +3016,8 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0, && can_split_parallel_of_n_reg_sets (i2, 2) && !reg_used_between_p (SET_DEST (XVECEXP (PATTERN (i2), 0, 0)), i2, i3) && !reg_used_between_p (SET_DEST (XVECEXP (PATTERN (i2), 0, 1)), i2, i3) - && !find_reg_note (i2, REG_UNUSED, 0)) + && !reg_set_between_p (SET_DEST (XVECEXP (PATTERN (i2), 0, 0)), i2, i3) + && !reg_set_between_p (SET_DEST (XVECEXP (PATTERN (i2), 0, 1)), i2, i3)) { /* If there is no I1, there is no I0 either. */ i0 = i1; |