public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Bin Cheng <Bin.Cheng@arm.com>
To: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Cc: nd <nd@arm.com>
Subject: [PATCH GCC][04/06]Add copying interface for dependence_info
Date: Mon, 14 Aug 2017 09:32:00 -0000	[thread overview]
Message-ID: <DB5PR0801MB274208DAE629CBB361C7A591E78C0@DB5PR0801MB2742.eurprd08.prod.outlook.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 560 bytes --]

HI,
This patch adds copying interface for dependence_info.  The methodology
is we don't copy such information by default, and this interface should
be called explicitly when it is safe and necessary to do so.  Just like
this patch uses the interface in ivopts.
Bootstrap and test in series.  Is it OK?

Thanks,
bin
2017-08-10  Bin Cheng  <bin.cheng@arm.com>

	* tree-ssa-address.c (copy_dependence_info): New function.
	* tree-ssa-address.h (copy_dependence_info): New declaration.
	* tree-ssa-loop-ivopts.c (rewrite_use_address): Call above func.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0004-copy-dep-fino-20170801.txt.patch --]
[-- Type: text/x-patch; name="0004-copy-dep-fino-20170801.txt.patch", Size: 2321 bytes --]

From 3cf0275d0db7d3e240bc7a010c6de68f15f46ce7 Mon Sep 17 00:00:00 2001
From: Bin Cheng <binche01@e108451-lin.cambridge.arm.com>
Date: Tue, 13 Jun 2017 15:57:24 +0100
Subject: [PATCH 4/6] copy-dep-fino-20170801.txt

---
 gcc/tree-ssa-address.c     | 17 +++++++++++++++++
 gcc/tree-ssa-address.h     |  1 +
 gcc/tree-ssa-loop-ivopts.c |  3 +++
 3 files changed, 21 insertions(+)

diff --git a/gcc/tree-ssa-address.c b/gcc/tree-ssa-address.c
index 8257fde..aea1730 100644
--- a/gcc/tree-ssa-address.c
+++ b/gcc/tree-ssa-address.c
@@ -958,6 +958,23 @@ get_address_description (tree op, struct mem_address *addr)
   addr->offset = TMR_OFFSET (op);
 }
 
+/* Copy data non-dependences info from FROM to TO which both are MEM_REF or
+   TARGET_MEM_REF.  */
+
+void
+copy_dependence_info (tree to, tree from)
+{
+  if ((TREE_CODE (from) != MEM_REF && TREE_CODE (from) != TARGET_MEM_REF)
+      || MR_DEPENDENCE_CLIQUE (from) == 0)
+    return;
+
+  gcc_assert (to != NULL_TREE);
+  gcc_assert (TREE_CODE (to) == MEM_REF || TREE_CODE (to) == TARGET_MEM_REF);
+  MR_DEPENDENCE_CLIQUE (to) = MR_DEPENDENCE_CLIQUE (from);
+  MR_DEPENDENCE_BASE (to) = MR_DEPENDENCE_BASE (from);
+  MR_DEPENDENCE_FIXED_LENGTH_P (to) = MR_DEPENDENCE_FIXED_LENGTH_P (from);
+}
+
 /* Copies the reference information from OLD_REF to NEW_REF, where
    NEW_REF should be either a MEM_REF or a TARGET_MEM_REF.  */
 
diff --git a/gcc/tree-ssa-address.h b/gcc/tree-ssa-address.h
index cd62ed9..ebba5ad 100644
--- a/gcc/tree-ssa-address.h
+++ b/gcc/tree-ssa-address.h
@@ -36,6 +36,7 @@ extern void move_fixed_address_to_symbol (struct mem_address *,
 					  struct aff_tree *);
 tree create_mem_ref (gimple_stmt_iterator *, tree,
 		     struct aff_tree *, tree, tree, tree, bool);
+extern void copy_dependence_info (tree, tree);
 extern void copy_ref_info (tree, tree);
 tree maybe_fold_tmr (tree);
 
diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c
index b65cd96..6b1efc1 100644
--- a/gcc/tree-ssa-loop-ivopts.c
+++ b/gcc/tree-ssa-loop-ivopts.c
@@ -7023,6 +7023,9 @@ rewrite_use_address (struct ivopts_data *data,
 			     iv, base_hint, data->speed);
 
   copy_ref_info (ref, *use->op_p);
+  /* Copy dependece information from the original reference.  */
+  copy_dependence_info (ref, *use->op_p);
+
   *use->op_p = ref;
 }
 
-- 
1.9.1


             reply	other threads:[~2017-08-14  9:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-14  9:32 Bin Cheng [this message]
2017-08-25  4:25 ` Jeff Law
2017-08-25 11:14   ` Richard Biener

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=DB5PR0801MB274208DAE629CBB361C7A591E78C0@DB5PR0801MB2742.eurprd08.prod.outlook.com \
    --to=bin.cheng@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=nd@arm.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).