public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Peter Bergner <bergner@linux.ibm.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Cc: "H.J. Lu" <hjl.tools@gmail.com>,
	Vladimir Makarov <vmakarov@redhat.com>,
	       Jeffrey Law <law@redhat.com>
Subject: Re: [PATCH 0/2][IRA,LRA] Fix PR86939, IRA incorrectly creates an interference between a pseudo register and a hard register
Date: Tue, 02 Oct 2018 21:53:00 -0000	[thread overview]
Message-ID: <31d4558f-11d0-67d4-b7e9-784243c0ab05@linux.ibm.com> (raw)
In-Reply-To: <a36ca2a1-044e-9fb1-dc31-984b2a3fe7d6@linux.ibm.com>

On 10/2/18 9:59 AM, Peter Bergner wrote:
> gcc/
> 	PR rtl-optimization/86939
> 	PR rtl-optimization/87479
> 	* ira.h (copy_insn_p): New prototype.
> 	* ira-lives.c (ignore_reg_for_conflicts): New static variable.
> 	(make_hard_regno_dead): Don't add conflicts for register
> 	ignore_reg_for_conflicts.
> 	(make_object_dead): Likewise.
> 	(copy_insn_p): New function.
> 	(process_bb_node_lives): Set ignore_reg_for_conflicts for copies.
> 	Remove special conflict handling of REAL_PIC_OFFSET_TABLE_REGNUM.
> 	* lra-lives.c (ignore_reg_for_conflicts): New static variable.
> 	(make_hard_regno_dead): Don't add conflicts for register
> 	ignore_reg_for_conflicts.  Remove special conflict handling of
> 	REAL_PIC_OFFSET_TABLE_REGNUM.  Remove now unused argument
> 	check_pic_pseudo_p and update callers.
> 	(mark_pseudo_dead): Don't add conflicts for register
> 	ignore_reg_for_conflicts.
> 	(process_bb_lives): Set ignore_reg_for_conflicts for copies.

So bootstrap and regtesting on powerpc64le-linux show no regressions.
Looking at the x86_64-linux results, I see one test suite regression:

  FAIL: gcc.target/i386/pr49095.c scan-assembler-times \\), % 8

I have included the function that is compiled differently with and
without the patch.  Looking at the IRA rtl dumps, there is pseudo
85 that is copied from and into hard reg 5 and we now no longer
report that they conflict.  That allows pesudo 85 to now be assigned
to hard reg 5, rather than hard reg 3 (old code) and that leads
to the code differences shown below.  I don't know x86_64 mnemonics
enough to say whether the code changes below are "better" or "similar"
or ???.  H.J., can you comment on the below code gen changes?
If they're better or similar to the old code, I could just modify
the expected results for pr49095.c.

Peter



[bergner@dagger1 PR87479]$ cat pr49095.i 
void foo (void *);

int *
f1 (int *x)
{
  if (!--*x)
    foo (x);
  return x;
}
[bergner@dagger1 PR87479]$ /data/bergner/gcc/build/gcc-fsf-mainline-pr87479-base-regtest/gcc/xgcc -B/data/bergner/gcc/build/gcc-fsf-mainline-pr87479-base-regtest/gcc/ -Os -fno-shrink-wrap -masm=att -ffat-lto-objects -fno-ident -S -o pr49095-base.s pr49095.i 
[bergner@dagger1 PR87479]$ /data/bergner/gcc/build/gcc-fsf-mainline-pr87479-regtest/gcc/xgcc -B/data/bergner/gcc/build/gcc-fsf-mainline-pr87479-regtest/gcc/ -Os -fno-shrink-wrap -masm=att -ffat-lto-objects -fno-ident -S -o pr49095-new.s pr49095.i 
[bergner@dagger1 PR87479]$ diff -u pr49095-base.s pr49095-new.s 
--- pr49095-base.s	2018-10-02 14:07:09.000000000 -0500
+++ pr49095-new.s	2018-10-02 14:07:40.000000000 -0500
@@ -5,16 +5,16 @@
 f1:
 .LFB0:
 	.cfi_startproc
+	subq	$24, %rsp
+	.cfi_def_cfa_offset 32
 	decl	(%rdi)
-	pushq	%rbx
-	.cfi_def_cfa_offset 16
-	.cfi_offset 3, -16
-	movq	%rdi, %rbx
 	jne	.L2
+	movq	%rdi, 8(%rsp)
 	call	foo
+	movq	8(%rsp), %rdi
 .L2:
-	movq	%rbx, %rax
-	popq	%rbx
+	movq	%rdi, %rax
+	addq	$24, %rsp
 	.cfi_def_cfa_offset 8
 	ret
 	.cfi_endproc

  parent reply	other threads:[~2018-10-02 19:45 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-26 21:14 Peter Bergner
2018-09-26 21:16 ` [PATCH 1/2][IRA,LRA] " Peter Bergner
2018-09-26 21:36 ` [PATCH 2/2][IRA,LRA] " Peter Bergner
2018-09-28 21:45 ` [PATCH 0/2][IRA,LRA] " Vladimir Makarov
2018-09-30 20:28   ` Peter Bergner
2018-10-01  0:57     ` H.J. Lu
2018-10-01  1:18       ` Peter Bergner
2018-10-01 12:46         ` H.J. Lu
2018-10-01 12:51           ` H.J. Lu
2018-10-01 13:16             ` H.J. Lu
2018-10-01 14:05               ` Peter Bergner
2018-10-02  4:08             ` Peter Bergner
2018-10-02 14:50               ` Jeff Law
2018-10-02 15:07               ` Peter Bergner
2018-10-02 15:37                 ` H.J. Lu
2018-10-02 15:55                   ` Peter Bergner
2018-10-02 17:14                     ` H.J. Lu
2018-10-02 21:53                 ` Peter Bergner [this message]
2018-10-02 22:28                   ` H.J. Lu
2018-10-03  0:35                     ` Peter Bergner
2018-10-03  2:23                       ` H.J. Lu
2018-10-03  2:46                         ` Peter Bergner
2018-10-03 14:43                 ` [PATCH 2/2 v3][IRA,LRA] " Peter Bergner
2018-10-04 22:18                   ` Vladimir Makarov
2018-10-05 16:50                     ` Peter Bergner
2018-10-05 18:54                       ` Vladimir Makarov
2018-10-05 20:10                         ` Peter Bergner
2018-10-05 22:56                           ` Vladimir Makarov
2018-10-06  6:40                             ` Peter Bergner
2018-10-08  9:37                               ` Christophe Lyon
2018-10-08 14:21                                 ` Peter Bergner
2018-10-08 14:46                                   ` Christophe Lyon
2018-10-08 15:04                                     ` Jeff Law
2018-10-11  2:57                                       ` Peter Bergner
2018-10-11 18:26                                         ` Peter Bergner
2018-10-11 20:31                                           ` Peter Bergner
2018-10-11 20:46                                             ` Jeff Law
2018-10-11 21:09                                               ` Peter Bergner
2018-10-11 21:36                                                 ` Jeff Law
2018-10-12  9:50                                                 ` Eric Botcazou
2018-10-11 21:05                                             ` Vladimir Makarov
2018-10-12 16:57                                               ` Peter Bergner
2018-10-12 17:56                                                 ` Jeff Law
2018-10-12  4:44                                             ` Jeff Law
2018-10-16  2:50                                               ` Peter Bergner
2018-11-01 18:50                                                 ` Renlin Li
2018-11-01 20:35                                                   ` Segher Boessenkool
2018-11-01 22:08                                                   ` Peter Bergner
2018-11-02 10:05                                                     ` Renlin Li
2018-11-05 19:20                                                     ` Jeff Law
2018-11-05 19:36                                                       ` Peter Bergner
2018-11-05 19:41                                                         ` Jeff Law
2018-11-06 10:52                                                           ` Renlin Li
2018-11-06 10:57                                                             ` Ramana Radhakrishnan
2018-11-06 12:23                                                               ` Renlin Li
2018-11-06 18:46                                                                 ` Peter Bergner
2018-11-06 18:58                                                             ` Jeff Law
2018-11-08 10:57                                                               ` Renlin Li
2018-11-08 11:49                                                                 ` Richard Biener
2018-11-08 14:29                                                                   ` Peter Bergner
2018-11-08 19:01                                                                     ` Peter Bergner
2018-11-08 12:35                                                                 ` Peter Bergner
2018-11-08 13:42                                                                   ` Renlin Li
2018-11-08 15:21                                                                 ` Peter Bergner
2018-11-08 16:20                                                                   ` Renlin Li
2018-11-08 17:52                                                                     ` Peter Bergner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=31d4558f-11d0-67d4-b7e9-784243c0ab05@linux.ibm.com \
    --to=bergner@linux.ibm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hjl.tools@gmail.com \
    --cc=law@redhat.com \
    --cc=vmakarov@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).